|
|
@ -26,15 +26,18 @@ class Reseni(bm.SeminarModelBase): |
|
|
|
verbose_name_plural = 'Řešení' |
|
|
|
#ordering = ['-problem', 'resitele'] # FIXME: Takhle to chceme, ale nefunguje to. |
|
|
|
ordering = ['-cas_doruceni'] |
|
|
|
managed = False |
|
|
|
|
|
|
|
# Interní ID |
|
|
|
id = models.AutoField(primary_key = True) |
|
|
|
|
|
|
|
# Ke každé dvojici řešní a problém existuje nanejvýš jedno hodnocení, doplnění vazby. |
|
|
|
problem = models.ManyToManyField(am.Problem, verbose_name='problém', help_text='Problém', |
|
|
|
related_name='problem_old', |
|
|
|
through='Hodnoceni') |
|
|
|
|
|
|
|
resitele = models.ManyToManyField(Resitel, verbose_name='autoři řešení', |
|
|
|
related_name='resitele_old', |
|
|
|
help_text='Seznam autorů řešení', through='Reseni_Resitele') |
|
|
|
|
|
|
|
|
|
|
@ -51,8 +54,8 @@ class Reseni(bm.SeminarModelBase): |
|
|
|
forma = models.CharField('forma řešení', max_length=16, choices=FORMA_CHOICES, blank=False, |
|
|
|
default=FORMA_EMAIL) |
|
|
|
|
|
|
|
text_cely = models.OneToOneField('ReseniNode', verbose_name='Plná verze textu řešení', |
|
|
|
blank=True, null=True, related_name="reseni_cely_set", |
|
|
|
text_cely = models.OneToOneField('seminar.ReseniNode', verbose_name='Plná verze textu řešení', |
|
|
|
blank=True, null=True, related_name="reseni_cely_set_old", |
|
|
|
on_delete=models.PROTECT) |
|
|
|
|
|
|
|
poznamka = models.TextField('neveřejná poznámka', blank=True, |
|
|
@ -95,6 +98,7 @@ class Hodnoceni(bm.SeminarModelBase): |
|
|
|
db_table = 'seminar_hodnoceni' |
|
|
|
verbose_name = 'Hodnocení' |
|
|
|
verbose_name_plural = 'Hodnocení' |
|
|
|
managed = False |
|
|
|
|
|
|
|
# Interní ID |
|
|
|
id = models.AutoField(primary_key = True) |
|
|
@ -104,16 +108,16 @@ class Hodnoceni(bm.SeminarModelBase): |
|
|
|
blank=True, null=True) |
|
|
|
|
|
|
|
cislo_body = models.ForeignKey(am.Cislo, verbose_name='číslo pro body', |
|
|
|
related_name='hodnoceni', blank=True, null=True, on_delete=models.PROTECT) |
|
|
|
related_name='hodnoceni_old', blank=True, null=True, on_delete=models.PROTECT) |
|
|
|
|
|
|
|
# V ročníku < 26 nastaveno na deadline vygenerovaný pro původní cislo_body |
|
|
|
deadline_body = models.ForeignKey(am.Deadline, verbose_name='deadline pro body', |
|
|
|
related_name='hodnoceni', blank=True, null=True, on_delete=models.PROTECT) |
|
|
|
related_name='hodnoceni_old', blank=True, null=True, on_delete=models.PROTECT) |
|
|
|
|
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', on_delete=models.CASCADE) |
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', on_delete=models.CASCADE, related_name='hodnoceni_old') |
|
|
|
|
|
|
|
problem = models.ForeignKey(am.Problem, verbose_name='problém', |
|
|
|
related_name='hodnoceni', on_delete=models.PROTECT) |
|
|
|
related_name='hodnoceni_old', on_delete=models.PROTECT) |
|
|
|
|
|
|
|
feedback = models.TextField('zpětná vazba', blank=True, default='', help_text='Zpětná vazba řešiteli (plain text)') |
|
|
|
|
|
|
@ -190,11 +194,12 @@ class PrilohaReseni(bm.SeminarModelBase): |
|
|
|
verbose_name = 'Příloha řešení' |
|
|
|
verbose_name_plural = 'Přílohy řešení' |
|
|
|
ordering = ['reseni', 'vytvoreno'] |
|
|
|
managed = False |
|
|
|
|
|
|
|
# Interní ID |
|
|
|
id = models.AutoField(primary_key = True) |
|
|
|
|
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', related_name='prilohy', |
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', related_name='prilohy_old', |
|
|
|
on_delete=models.CASCADE) |
|
|
|
|
|
|
|
vytvoreno = models.DateTimeField('vytvořeno', default=timezone.now, blank=True, editable=False) |
|
|
@ -225,13 +230,14 @@ class Reseni_Resitele(models.Model): |
|
|
|
verbose_name = 'Řešení řešitelů' |
|
|
|
verbose_name_plural = 'Řešení řešitelů' |
|
|
|
ordering = ['reseni', 'resitele'] |
|
|
|
managed = False |
|
|
|
|
|
|
|
# Interní ID |
|
|
|
id = models.AutoField(primary_key = True) |
|
|
|
|
|
|
|
resitele = models.ForeignKey(Resitel, verbose_name='řešitel', on_delete=models.PROTECT) |
|
|
|
resitele = models.ForeignKey(Resitel, verbose_name='řešitel', on_delete=models.PROTECT, related_name='rere_old') |
|
|
|
|
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', on_delete=models.CASCADE) |
|
|
|
reseni = models.ForeignKey(Reseni, verbose_name='řešení', on_delete=models.CASCADE, related_name='rere_old') |
|
|
|
|
|
|
|
# podil - jakou merou se ktery resitel podilel na danem reseni |
|
|
|
# - pouziti v budoucnu, pokud by resitele nemeli dostat vsichni stejne bodu za spolecne reseni |
|
|
|