From ee5b0032460a6265fddcc0a8cdf6aa31b7697283 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Thu, 19 Aug 2021 14:40:19 +0200
Subject: [PATCH] =?UTF-8?q?DB:=20Place=20m=C3=A1=20vztah=20pro=20rodi?=
 =?UTF-8?q?=C4=8De?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 mo/db.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mo/db.py b/mo/db.py
index 6fbf140d..3c795049 100644
--- a/mo/db.py
+++ b/mo/db.py
@@ -99,6 +99,7 @@ class Place(Base):
     nuts = Column(String(255), unique=True, server_default=text("NULL::character varying"))
     note = Column(Text, nullable=False, server_default=text("''::text"))
 
+    parent_place = relationship('Place', primaryjoin='Place.parent == Place.place_id', remote_side='Place.place_id')
     children = relationship('Place')
     school = relationship('School', uselist=False, back_populates='place')
 
-- 
GitLab