|
|
@ -1,16 +1,25 @@ |
|
|
|
import logging |
|
|
|
import datetime |
|
|
|
import random |
|
|
|
from typing import Sequence |
|
|
|
|
|
|
|
import lorem |
|
|
|
|
|
|
|
from .models import Soustredeni, Konfera |
|
|
|
import seminar.models.tvorba as am |
|
|
|
import personalni.models as pm |
|
|
|
|
|
|
|
logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
|
def gen_soustredeni(size, rnd, resitele, organizatori): |
|
|
|
logger.info('Generuji soustředění...') |
|
|
|
def gen_soustredeni( |
|
|
|
size: int, |
|
|
|
resitele: Sequence[pm.Resitel], |
|
|
|
organizatori: Sequence[pm.Organizator], |
|
|
|
rnd: random.Random = None, |
|
|
|
) -> Sequence[Soustredeni]: |
|
|
|
logger.info('Generuji soustředění (size={})...') |
|
|
|
rnd = rnd or random.Random(x=42) |
|
|
|
|
|
|
|
soustredeni = [] |
|
|
|
for _ in range(1, 10): # FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?) |
|
|
@ -35,8 +44,15 @@ def gen_soustredeni(size, rnd, resitele, organizatori): |
|
|
|
return soustredeni |
|
|
|
|
|
|
|
|
|
|
|
def gen_konfery(size, rnd, organizatori, resitele, soustredeni): |
|
|
|
def gen_konfery( |
|
|
|
size: int, |
|
|
|
organizatori: Sequence[pm.Organizator], |
|
|
|
resitele: Sequence[pm.Resitel], |
|
|
|
soustredeni: Sequence[Soustredeni], |
|
|
|
rnd: random.Random = None, |
|
|
|
) -> Sequence[Konfera]: |
|
|
|
logger.info('Generuji konfery (size={})...'.format(size)) |
|
|
|
rnd = rnd or random.Random(x=42) |
|
|
|
|
|
|
|
konfery = [] |
|
|
|
for _ in range(1, size): # FIXME Tu range si změňte jak chcete, nevím, co přesně znamená size (asi Anet?) |
|
|
|