Browse Source

Fix v gen_konfery a gen_soustredeni

export_seznamu_prednasek
Martin Z. (Zimamazim) 5 years ago
parent
commit
09161f169c
  1. 13
      seminar/testutils.py

13
seminar/testutils.py

@ -207,10 +207,9 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
)
return
# FIXME Každé funkci se předává nějaké rnd, netuším, co to je. Pokud to tam má být, tak to tam přijdejte, pokud ne, tak je tato poznámka bezpředmětná.
def gen_soustredeni(resitele, organizatori):
def gen_soustredeni(rnd, resitele, organizatori):
soustredeni = []
for sousi in range(1, size): #FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?)
for _ in range(1, size): #FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?)
datum_zacatku=datetime.date(randint(2000, 2020), randint(1, 12), radint(1, 28))
working_sous = Soustredeni.objects.create(
rocnik=Rocnik.objects.order_by('?').first(),
@ -237,20 +236,18 @@ def gen_rocniky(last_rocnik, size):
rocniky.append(rocnik)
return rocniky
# FIXME Každé funkci se předává nějaké rnd, netuším, co to je. Pokud to tam má být, tak to tam přijdejte, pokud ne, tak je tato poznámka bezpředmětná.
def gen_konfery(organizatori, ucastnici, soustredeni):
def gen_konfery(rnd, reseni, organizatori, ucastnici, soustredeni):
konfery = []
for konferai in range(1, size): #FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?)
for _ in range(1, size): #FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?)
konfera = Konfera.objects.create(
nazev=rnd.choice(['Pozorování', 'Zkoumání', 'Modelování', 'Počítání', 'Zkoušení']) + rnd.choice(' vlastností', ' jevů', ' charakteristik']) + rnd.choice([' vektorových prostorů', ' kinetické terorie látek', ' molekulární biologie', ' syntentických stromů']),
anotace=lorem.paragraph(),
abstrakt=lorem.paragraph(),
organizator=rnd.choice(organizatori),
ucastnici=rnd.choice(ucastnici),
soustredeni=rnd.choice(soustredeni),
reseni=rnd.choice(reseni),
typ_prezentace=rnd.choice(['veletrh', 'prezentace']))
for res in rnd.sample(resitele, min(len(resitele), randint(3, 6))):
for res in rnd.sample(ucastnici, min(len(ucastnici), randint(3, 6))):
Konfery_Ucastnici.objects.create(resitel=res, konfera=konfera)
konfery.append(konfera)
konfera.save()

Loading…
Cancel
Save