Generování konfer s konkrétními řešiteli
This commit is contained in:
parent
bf748b55ee
commit
d952ab13a5
2 changed files with 3 additions and 3 deletions
|
@ -840,7 +840,7 @@ def create_test_data(size = 6, rnd = None):
|
|||
soustredeni = gen_soustredeni(size, resitele, organizatori, rnd=rnd)
|
||||
|
||||
#generování konfer
|
||||
konfery = gen_konfery(size, organizatori, resitele, soustredeni, rnd=rnd)
|
||||
konfery = gen_konfery(size, organizatori, soustredeni, rnd=rnd)
|
||||
|
||||
# vytvoreni pdf ke korekturam
|
||||
create_test_pdf(rnd, organizatori)
|
||||
|
|
|
@ -43,8 +43,8 @@ def gen_soustredeni(
|
|||
def gen_konfery(
|
||||
size: int,
|
||||
organizatori: Sequence[pm.Organizator],
|
||||
resitele: Sequence[pm.Resitel],
|
||||
soustredeni: Sequence[Soustredeni],
|
||||
resitele: Sequence[pm.Resitel] = None,
|
||||
rnd: random.Random = None,
|
||||
) -> Sequence[Konfera]:
|
||||
logger.info('Generuji konfery (size={})...'.format(size))
|
||||
|
@ -61,7 +61,7 @@ def gen_konfery(
|
|||
garant=rnd.choice(organizatori),
|
||||
soustredeni=rnd.choice(soustredeni),
|
||||
typ_prezentace=rnd.choice(['veletrh', 'prezentace']))
|
||||
ucastnici_sous = list(konfera.soustredeni.ucastnici.all())
|
||||
ucastnici_sous = resitele if resitele else list(konfera.soustredeni.ucastnici.all())
|
||||
ucastnici = rnd.sample(ucastnici_sous, min(len(ucastnici_sous), rnd.randint(3, 6)))
|
||||
konfera.ucastnici.set(ucastnici)
|
||||
konfera.save()
|
||||
|
|
Loading…
Reference in a new issue