diff --git a/mo/db.py b/mo/db.py index 6fbf140dac9cc0597f52cb246466f2e9450395fb..3c795049a35e2cf28f32a0c145ef9e0be5c06a2d 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')