A nakonec to stejně SQL je...
This commit is contained in:
		
							parent
							
								
									3a56eafa59
								
							
						
					
					
						commit
						54e728d2be
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		|  | @ -1,11 +1,6 @@ | |||
| from django.db import migrations | ||||
| 
 | ||||
| def oprav_ulohy(apps, schema_editor): | ||||
| 	Problem = apps.get_model('seminar', 'Pohadka') | ||||
| 
 | ||||
| 	for p in Problem.objects.filter(typ="b'uloha'"): | ||||
| 		p.typ = "uloha" | ||||
| 		p.save() | ||||
| sql = "update seminar_problemy set typ = 'uloha' where typ like 'b_uloha_';" | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|  | @ -14,6 +9,6 @@ class Migration(migrations.Migration): | |||
| 	] | ||||
| 
 | ||||
| 	operations = [ | ||||
| 		migrations.RunPython(oprav_ulohy, oprav_ulohy), | ||||
| 		migrations.RunSQL(sql, sql), | ||||
| 	] | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Pavel "LEdoian" Turinsky
						Pavel "LEdoian" Turinsky