Testdata: Fix CHOICES
v DB byl bordel (celé tuply), nevešly se do postgresového limitu.
This commit is contained in:
		
							parent
							
								
									cd5e17b572
								
							
						
					
					
						commit
						d57214446d
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -104,7 +104,7 @@ def gen_resitele(rnd, osoby, skoly): | |||
| 		if not (rand % 8 == 0): | ||||
| 			resitele.append(Resitel.objects.create(osoba=os, skola=rnd.choice(skoly),  | ||||
| 				rok_maturity=rnd.randint(2019, 2029),  | ||||
| 				zasilat=rnd.choice(Resitel.ZASILAT_CHOICES))) | ||||
| 				zasilat=rnd.choice(Resitel.ZASILAT_CHOICES)[0])) | ||||
| 	return resitele | ||||
| 
 | ||||
| def gen_prijemci(rnd, osoby, kolik=10): | ||||
|  | @ -218,7 +218,7 @@ def gen_ulohy_do_cisla(rnd, organizatori, resitele, rocnik_cisla, rocniky, size) | |||
| 					res_vyber = rnd.sample(resitele, rnd.randint(1, 5)) | ||||
| 					# problem a resitele přiřadíme později, ManyToManyField | ||||
| 					# se nedá vyplnit v create() | ||||
| 					res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES)) | ||||
| 					res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES)[0]) | ||||
| 					#res.save() <- asi smazat | ||||
| 					res.resitele.set(res_vyber) | ||||
| 					res.save() | ||||
|  | @ -367,7 +367,7 @@ def gen_temata(rnd, rocniky, rocnik_cisla, organizatori): | |||
| 				garant=rnd.choice(organizatori),  | ||||
| 				kod=str(n), | ||||
| 				# atributy třídy Téma | ||||
| 				tema_typ=rnd.choice(Tema.TEMA_CHOICES), | ||||
| 				tema_typ=rnd.choice(Tema.TEMA_CHOICES)[0], | ||||
| 				rocnik=rocnik | ||||
| 			) | ||||
| 			konec_tematu = min(rnd.randint(ci, 7), len(cisla)) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Pavel "LEdoian" Turinsky
						Pavel "LEdoian" Turinsky