Rozbité problémy vyřešeny metodou ŽAVES
This commit is contained in:
parent
10e0fd9b4a
commit
7f93171c39
1 changed files with 8 additions and 4 deletions
|
@ -17,11 +17,15 @@ from django.db import connection
|
|||
def smaz_zle_clanky():
|
||||
# Tyhle clanky vubec nejsou clanky, bude potreba je udelat cele jinak a spravne.
|
||||
#m.Problem.objects.filter(id__in=[1981, 1970, 2222]).delete()
|
||||
## with connection.cursor() as cursor:
|
||||
## # Nejdriv musime smazat reseni:
|
||||
## cursor.execute('DELETE FROM seminar_reseni WHERE problem_id IN (1981, 1970, 2222);')
|
||||
## # Nakonec i ty clanky samotne
|
||||
## cursor.execute('DELETE FROM seminar_problemy WHERE id IN (1981, 1970, 2222);')
|
||||
|
||||
# Update: stejně je v DB bordel, tak z nich prostě jen udělám témata a všechno zhruba přežije…
|
||||
with connection.cursor() as cursor:
|
||||
# Nejdriv musime smazat reseni:
|
||||
cursor.execute('DELETE FROM seminar_reseni WHERE problem_id IN (1981, 1970, 2222);')
|
||||
# Nakonec i ty clanky samotne
|
||||
cursor.execute('DELETE FROM seminar_problemy WHERE id IN (1981, 1970, 2222);')
|
||||
cursor.execute("UPDATE seminar_problemy SET typ = 'tema' WHERE id IN (1981, 1970, 2222);")
|
||||
|
||||
def smaz_divne_uzivatele():
|
||||
# U techto uzivatelu neexistuje Organizator s nimi spojeny
|
||||
|
|
Loading…
Reference in a new issue