Commit 694e2c5a48befdaa0daeac5aa7a133cff86c82fa
1 parent
9ee58687
Exists in
master
and in
5 other branches
correção de imports no model de exam #171
Showing
2 changed files
with
13 additions
and
7 deletions
Show diff stats
amadeus/settings.py
exam/models.py
| 1 | +from django.utils.translation import ugettext_lazy as _ | |
| 1 | 2 | from django.db import models |
| 3 | +from autoslug.fields import AutoSlugField | |
| 4 | +from users.models import User | |
| 5 | +from core.models import Resource | |
| 6 | + | |
| 2 | 7 | |
| 3 | 8 | class Exam(models.Model): |
| 4 | 9 | name = models.CharField(_('Name'), max_length = 100) |
| 5 | 10 | beginDate = models.DateTimeField(_('Start Date'), auto_now_add = True) |
| 6 | 11 | endDate = models.DateTimeField(_('Date of last update'), auto_now=True) |
| 7 | 12 | |
| 8 | - class Meta: | |
| 9 | - | |
| 10 | - verbose_name = _('Exam') | |
| 11 | - verbose_name_plural = _('Exams') | |
| 13 | + class Meta: | |
| 14 | + #ordering = ('create_date','name') | |
| 15 | + verbose_name = _('Exam') | |
| 16 | + verbose_name_plural = _('Exams') | |
| 12 | 17 | |
| 13 | - def __str__(self): | |
| 14 | - return str(self.name) + str("/") + str(self.topic) | |
| 18 | + def __str__(self): | |
| 19 | + return str(self.name) + str("/") + str(self.topic) | |
| 15 | 20 | |
| 16 | 21 | class Answer(models.Model): |
| 17 | 22 | answer = models.CharField(_("Answer"), max_length = 200) |
| 18 | 23 | order = models.PositiveSmallIntegerField(_("Order")) |
| 19 | - exam = models.ForeignKey(Poll, verbose_name = _('Answers'), related_name='answers') | |
| 24 | + exam = models.ForeignKey(Exam, verbose_name = _('Answers'), related_name='answers') | |
| 20 | 25 | |
| 21 | 26 | class Meta: |
| 22 | 27 | ordering = ('order',) | ... | ... |