|
@ -17,11 +17,15 @@ from django.db import connection |
|
|
def smaz_zle_clanky(): |
|
|
def smaz_zle_clanky(): |
|
|
# Tyhle clanky vubec nejsou clanky, bude potreba je udelat cele jinak a spravne. |
|
|
# Tyhle clanky vubec nejsou clanky, bude potreba je udelat cele jinak a spravne. |
|
|
#m.Problem.objects.filter(id__in=[1981, 1970, 2222]).delete() |
|
|
#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: |
|
|
with connection.cursor() as cursor: |
|
|
# Nejdriv musime smazat reseni: |
|
|
cursor.execute("UPDATE seminar_problemy SET typ = 'tema' WHERE id IN (1981, 1970, 2222);") |
|
|
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);') |
|
|
|
|
|
|
|
|
|
|
|
def smaz_divne_uzivatele(): |
|
|
def smaz_divne_uzivatele(): |
|
|
# U techto uzivatelu neexistuje Organizator s nimi spojeny |
|
|
# U techto uzivatelu neexistuje Organizator s nimi spojeny |
|
|