From 9a071bd43529a40012ca7c8e3db6452ff1174305 Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Mon, 19 Dec 2016 15:38:10 -0800 Subject: [PATCH] add issue status --- ttadmin/help/admin.py | 2 +- .../migrations/0002_ticket_issue_status.py | 20 +++++++++++++++++++ ttadmin/help/models.py | 12 +++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ttadmin/help/migrations/0002_ticket_issue_status.py diff --git a/ttadmin/help/admin.py b/ttadmin/help/admin.py index e12a0a5..9b05efd 100644 --- a/ttadmin/help/admin.py +++ b/ttadmin/help/admin.py @@ -3,4 +3,4 @@ from .models import Ticket @admin.register(Ticket) class TicketAdmin(admin.ModelAdmin): - pass + list_display = ('issue_status', 'issue_type', 'name', 'email') diff --git a/ttadmin/help/migrations/0002_ticket_issue_status.py b/ttadmin/help/migrations/0002_ticket_issue_status.py new file mode 100644 index 0000000..4b6d434 --- /dev/null +++ b/ttadmin/help/migrations/0002_ticket_issue_status.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2016-12-19 23:36 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('help', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='ticket', + name='issue_status', + field=models.CharField(choices=[('triage', 'to triage'), ('acked', 'acknowledged'), ('waiting', 'waiting to hear from submitter'), ('completed', 'nothing more to do')], default='triage', max_length=50), + ), + ] diff --git a/ttadmin/help/models.py b/ttadmin/help/models.py index 4b6c4f3..2d92ae5 100644 --- a/ttadmin/help/models.py +++ b/ttadmin/help/models.py @@ -9,6 +9,13 @@ ISSUE_TYPE_CHOICES = ( ('other', 'something else'), ) +ISSUE_STATUS_CHOICES = ( + ('triage', 'to triage'), + ('acked', 'acknowledged'), + ('waiting', 'waiting to hear from submitter'), + ('completed', 'nothing more to do'), +) + class Ticket(Model): name = TextField(blank=False, null=False) @@ -18,6 +25,11 @@ class Ticket(Model): null=False, max_length=50) issue_text = TextField(blank=False, null=False) + issue_status = CharField(choices=ISSUE_STATUS_CHOICES, + blank=False, + null=False, + max_length=50, + default=ISSUE_STATUS_CHOICES[0][0]) def __str__(self): return '{} from {}'.format(self.issue_type, self.name)