diff options
author | Filipp Lepalaan <f@230.to> | 2013-11-17 19:15:30 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-11-17 19:15:30 +0200 |
commit | 297419f370ea87458017ee506a2e551e9068b66b (patch) | |
tree | 429d3e1b6c7f2facfb3e361b4b708f0d36e8aac8 /apps/issues/models.py | |
parent | f077badf3163fc36c111dc45fe8d7d6f57d8712a (diff) | |
download | motor.old-297419f370ea87458017ee506a2e551e9068b66b.tar.gz motor.old-297419f370ea87458017ee506a2e551e9068b66b.tar.bz2 motor.old-297419f370ea87458017ee506a2e551e9068b66b.zip |
Swicthing machines
Diffstat (limited to 'apps/issues/models.py')
-rw-r--r-- | apps/issues/models.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/issues/models.py b/apps/issues/models.py new file mode 100644 index 0000000..bcded0c --- /dev/null +++ b/apps/issues/models.py @@ -0,0 +1,33 @@ +from django.db import models +from django.utils.translation import ugettext as _ + +from apps.core.models import ServiceProvider +from apps.checkin.models import ServiceOrder + + +class Issue(models.Model): + sp = models.ForeignKey(ServiceProvider) + description = models.CharField(max_length=256, default=_('No power')) + + def __unicode__(self): + return self.description + + def get_absolute_url(self): + return '/manage/issues/%d/' % self.pk + + +class Question(models.Model): + issue = models.ForeignKey(Issue) + question = models.CharField(max_length=256) + required = models.BooleanField(default=True) + + +class Choice(models.Model): + question = models.ForeignKey(Question) + choice = models.CharField(max_length=256) + + +class Answer(models.Model): + choice = models.ForeignKey(Choice) + answer = models.CharField(max_length=256) + so = models.ForeignKey(ServiceOrder) |