Seřazení podproblémů podle kódu místo podle jména
This commit is contained in:
		
							parent
							
								
									9cb5c8ca59
								
							
						
					
					
						commit
						abc479b549
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -310,7 +310,13 @@ def podproblemy_v_cislu(cislo, problemy=None, hlavni_problemy=None): | |||
| 			podproblemy[-1].append(problem) | ||||
| 
 | ||||
| 	for podproblem in podproblemy.keys(): | ||||
| 		podproblemy[podproblem] = sorted(podproblemy[podproblem], key=lambda it: it.kod) | ||||
| 		def int_or_zero(p): | ||||
| 			try: | ||||
| 				return int(p.kod) | ||||
| 			except ValueError: | ||||
| 				return 0 | ||||
| 
 | ||||
| 		podproblemy[podproblem] = sorted(podproblemy[podproblem], key=int_or_zero) | ||||
| 
 | ||||
| 	return podproblemy | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue