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)