|
|
@ -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() |
|
|
|