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