es = sub_territories.union(
session.query(porteur.id,porteur.name,porteur.scale). \
# filter(porteur.id == relation.c.child_id). \
filter(porteur.id == relation.c.child_id). \
filter(relation.c.parent_id == sub_territories.c.id). \
filter(sub_territories.c.scale != 'region'))
# sub_territ
I created this recursive query:
element0 = aliased(Territoire)
sub_territories = session.query(element0, element0.id). \
filter(element0.id == 1). \
filter(element0.scale != 'Region'). \
cte(name='sub_territories', recursive=True)
st_alias = aliased(sub_territori
hello!
I created this recursive query:
element0 = aliased(Territoire)
sub_territories = session.query(element0, element0.id). \
filter(element0.id == 1). \
filter(element0.scale != 'Region'). \
cte(name='sub_territories', recursive=True)
st_alias = aliased(sub_