Vylepseni generovani test. dat
This commit is contained in:
parent
557c1d55e1
commit
a66cdbd234
1 changed files with 7 additions and 1 deletions
|
@ -33,11 +33,17 @@ def create_test_data():
|
|||
Skola.objects.create(mesto = u'Humenné', stat='SK', psc='012 34', ulice=u'Pltká 1', nazev=u'Sredná škuola')
|
||||
|
||||
# resitele
|
||||
jmena_m = ['Aleš', 'Tomáš', 'Martin', 'Jakub', 'Petr', 'Lukáš', 'Cyril']
|
||||
jmena_f = ['Eva', 'Karolína', 'Zuzana', 'Sylvie', 'Iva', 'Jana', 'Marie']
|
||||
prijmeni_m = ['Novotný', 'Svoboda', 'Pecha', 'Kořen', 'Holan', 'Uhlíř', 'Chytráček', 'Pokora', 'Koch', 'Szegedy', 'Rudý']
|
||||
prijmeni_f = ['Novotná', 'Svobodová', 'Machová', 'Zelená', 'Yu-Xin', 'Mlsná', 'Dubná', 'Mrkvová', 'Suchá', 'Lovelace', 'Holcová']
|
||||
for i in range(20):
|
||||
skola = rnd.choice(Skola.objects.all())
|
||||
pohlavi = rnd.randint(0,1)
|
||||
jmeno = rnd.choice([jmena_m, jmena_f][pohlavi])
|
||||
prijmeni = rnd.choice([prijmeni_m, prijmeni_f][pohlavi])
|
||||
Resitel.objects.create(skola = skola, datum_prihlaseni = datetime.date(rnd.randint(2002, 2014), rnd.randint(1,12), 1),
|
||||
jmeno = u'Řešitel' if pohlavi else u'Řešitelka', prijmeni = 'Číslo-%s' % (i), rok_maturity = rnd.randint(2015, 2019),
|
||||
jmeno =jmeno, prijmeni = prijmeni, rok_maturity = rnd.randint(2015, 2019),
|
||||
stat = skola.stat, zasilat = Resitel.ZASILAT_NIKAM, pohlavi_muz = pohlavi)
|
||||
resitele = list(Resitel.objects.all())
|
||||
|
||||
|
|
Loading…
Reference in a new issue