Revert "m0060: likvidace sirotku ve stromu"

This reverts commit 7f89af129f.

Pushuju blbosti :-)
This commit is contained in:
Pavel Turinsky (DebianVM @ Zr) 2021-06-30 01:01:35 +00:00
parent 7f89af129f
commit df682e0630
3 changed files with 11 additions and 19 deletions

View file

@ -3,8 +3,8 @@
import psycopg2
import psycopg2.extras
OLD_DB = "mam-prod"
NEW_DB = "mam-test"
OLD_DB = "mam_old"
NEW_DB = "mamweb"
oldconn = psycopg2.connect(f"dbname={OLD_DB}")
newconn = psycopg2.connect(f"dbname={NEW_DB}")

View file

@ -39,13 +39,13 @@ DATABASES = {
'NAME': os.path.join(BASE_DIR, 'db-local.sqlite3'),
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mam-test',
'USER': 'kam',
},
}
#DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'mam_local',
# 'USER': 'mam',
# },
#}
# LOGGING
LOGGING = {

View file

@ -6,15 +6,6 @@ from django.db import migrations
from django.db.models import Q
def nastav_koren(koren, node):
node.root = koren
node.save()
if node.succ:
nastav_koren(koren, node.succ)
if node.first_child:
nastav_koren(koren, node.first_child)
def pridej_potomka(rodic, potomek):
# Daný vrchol bude posledním potomkem rodiče
uz_ma_deti = False
@ -32,7 +23,8 @@ def pridej_potomka(rodic, potomek):
posledni = posledni.succ
# Nastavíme kořen:
nastav_koren(rodic.root, potomek)
potomek.root = rodic.root
potomek.save()
# Připojíme vrchol:
if uz_ma_deti: