tildetown-admin/ttadmin/help/models.py

24 lines
775 B
Python
Raw 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 05:15:06 +00:00
class Ticket(Model):
2016-12-19 07:20:48 +00:00
name = TextField(blank=False, null=False)
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)
def __str__(self):
return '{} from {}'.format(self.issue_type, self.name)