Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations
This commit is contained in:
commit
67bb3e76b0
2 changed files with 6 additions and 28 deletions
|
@ -198,10 +198,11 @@ class Prijemce(SeminarModelBase):
|
|||
poznamka = models.TextField('neveřejná poznámka', blank=True,
|
||||
help_text='Neveřejná poznámka k příemci čísel (plain text)')
|
||||
|
||||
osoba = models.ForeignKey(Osoba, verbose_name='komu', blank=False, null=False,
|
||||
osoba = models.OneToOneField(Osoba, verbose_name='komu', blank=False, null=False,
|
||||
help_text='Které osobě či na jakou adresu se mají zasílat čísla')
|
||||
|
||||
# FIXME: možná chceme něco jako vazbu na osobu XOR školu a počet kusů k zaslání
|
||||
# FIXME: a možná taky posílání na mail a možná taky přes něj chceme posílat i řešitelům
|
||||
|
||||
def __str__(self):
|
||||
return self.osoba.plne_jmeno()
|
||||
|
|
|
@ -125,11 +125,7 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
|
|||
'''
|
||||
cislo = cislo cisla v rocniku, nikoli objekt Cislo
|
||||
'''
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b
|
||||
# ulohy resene v ci
|
||||
# ulohy resene v cisle
|
||||
jaka = ["Šachová", "Černá", "Větrná", "Dlouhá", "Křehká", "Rychlá",
|
||||
"Zákeřná", "Fyzikální"]
|
||||
co = ["kostka", "smršť", "díra", "zrada", "toulka", "tyč",
|
||||
|
@ -164,13 +160,6 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
|
|||
cislo_zadani=slovnik_cisel[cislo-2],
|
||||
cislo_reseni=slovnik_cisel[cislo],
|
||||
cislo_deadline=slovnik_cisel[cislo],
|
||||
<<<<<<< HEAD
|
||||
max_body = rnd.randint(1, 8))
|
||||
p.zadani = " ".join([rnd.choice(sloveso), rnd.choice(koho),
|
||||
rnd.choice(ceho), rnd.choice(jmeno), rnd.choice(kde)])
|
||||
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
|
||||
p.opravovatele = rnd.sample(organizatori, poc_op)
|
||||
=======
|
||||
max_body = rnd.randint(1, 8)
|
||||
)
|
||||
p.zadani = " ".join(
|
||||
|
@ -180,8 +169,8 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
|
|||
rnd.choice(jmeno),
|
||||
rnd.choice(kde)]
|
||||
)
|
||||
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
|
||||
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b
|
||||
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
|
||||
p.opravovatele = rnd.sample(organizatori, poc_op)
|
||||
p.save()
|
||||
|
||||
# reseni ulohy
|
||||
|
@ -191,7 +180,6 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
|
|||
# (nebo skoro vsechny resitele, pokud jich je mene nez pocet reseni)
|
||||
res_vyber = rnd.sample(resitele, min(poc_reseni, len(resitele) - 2))
|
||||
for resitel in res_vyber:
|
||||
<<<<<<< HEAD
|
||||
# problem a resitele přiřadíme později, ManyToManyField
|
||||
# se nedá vyplnit v create()
|
||||
res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES))
|
||||
|
@ -201,21 +189,10 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
|
|||
hod = Hodnoceni.objects.create(
|
||||
body=rnd.randint(0, p.max_body),
|
||||
cislo_body=slovnik_cisel[cislo],
|
||||
reseni=res, problem=p)
|
||||
=======
|
||||
res = Reseni.objects.create(
|
||||
problem = p,
|
||||
resitele=[resitel],
|
||||
forma=rnd.choice(Reseni.FORMA_CHOICES)
|
||||
)
|
||||
hod = Hodnoceni.objects.create(
|
||||
body=rnd.randint(0, p.max_body),
|
||||
cislo_body=slovnik_cisel[cislo],
|
||||
reseni=res,
|
||||
problem=p
|
||||
)
|
||||
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b
|
||||
return
|
||||
return
|
||||
|
||||
def gen_soustredeni():
|
||||
# TODO: vice soustredeni a k nim nahodne podmnoziny organizatoru a ucastniku
|
||||
|
|
Loading…
Reference in a new issue