tildetown-admin/ttadmin/help/models.py

36 lines
1.2 KiB
Python
Raw Permalink Normal View History

2016-12-19 07:20:48 +00:00
from django.db.models import Model, TextField, EmailField, CharField
ISSUE_TYPE_CHOICES = (
('logging_in', 'help logging in'),
('concern_site', 'concern about the site'),
('concern_user', 'concern about another user'),
('package', 'install a package'),
('question', 'just a question',),
('other', 'something else'),
)
2016-12-19 23:38:10 +00:00
ISSUE_STATUS_CHOICES = (
('triage', 'to triage'),
('acked', 'acknowledged'),
('waiting', 'waiting to hear from submitter'),
('completed', 'nothing more to do'),
)
2016-12-19 05:15:06 +00:00
class Ticket(Model):
name = CharField(blank=False, null=False, max_length=100)
2016-12-19 07:20:48 +00:00
email = EmailField(blank=False, null=False)
issue_type = CharField(choices=ISSUE_TYPE_CHOICES,
blank=False,
null=False,
max_length=50)
issue_text = TextField(blank=False, null=False)
2016-12-19 23:38:10 +00:00
issue_status = CharField(choices=ISSUE_STATUS_CHOICES,
blank=False,
null=False,
max_length=50,
default=ISSUE_STATUS_CHOICES[0][0])
2016-12-19 07:20:48 +00:00
def __str__(self):
return '{} from {}'.format(self.issue_type, self.name)