Skip to content

Commit

Permalink
only one level in subrelation-tree
Browse files Browse the repository at this point in the history
* in the subrelation list only one (current) level of child relations
  is displayed. The next level appears, once a subrelation is
  selected. That way one can easily navigate through the relation tree.
* the list of parent relations only shows the next parent
  (without this change all parents in the tree were displayed)

This was the behaviour before the sqlalchemy port. See also #65.
  • Loading branch information
jschleic committed May 28, 2016
1 parent d162ed8 commit a61a545
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/details.py
Expand Up @@ -190,9 +190,9 @@ def _hierarchy_list(self, rid, subs):
h = mapdb.tables.hierarchy.data

if subs:
w = sa.select([h.c.child], distinct=True).where(h.c.parent == rid)
w = sa.select([h.c.child], distinct=True).where(h.c.parent == rid).where(h.c.depth == 2)
else:
w = sa.select([h.c.parent], distinct=True).where(h.c.child == rid)
w = sa.select([h.c.parent], distinct=True).where(h.c.child == rid).where(h.c.depth == 2)

sections = sa.select([r.c.id, r.c.name, r.c.intnames,
r.c[self.level_column].label('level')])\
Expand Down

0 comments on commit a61a545

Please sign in to comment.