diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-07-09 13:40:04 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-07-09 13:40:04 +0200 |
commit | 0dc5a4607b54a95f0fc04cb0bb20c152180c44ae (patch) | |
tree | 55798a74a2c603a06fe38cbb6e1ad9d69bf4b9eb /ishtar_common/utils.py | |
parent | e96307ce15ee1315116dbaa63e825fc4f0d8c586 (diff) | |
download | Ishtar-0dc5a4607b54a95f0fc04cb0bb20c152180c44ae.tar.bz2 Ishtar-0dc5a4607b54a95f0fc04cb0bb20c152180c44ae.zip |
Graph generation: fix non full generation with changing relation type - attach full to upper item
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index ebfbaaa77..eb8414ced 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -1160,18 +1160,16 @@ def get_relations_for_graph(rel_model, obj_pk, above_relations=None, other_record = left_record else: other_record = right_record - - render_bellow = False if get_above and get_bellow and not full and (is_bellow or is_above): - if is_above: + if (is_above and not inverse) or (is_bellow and inverse): ar, er, substyles = get_relations_for_graph( rel_model, other_record, above_relations, equal_relations, treated, styles, render_above=True, render_bellow=False ) - elif is_bellow: + else: ar, er, substyles = get_relations_for_graph( rel_model, other_record, above_relations, equal_relations, treated, styles, @@ -1278,6 +1276,10 @@ def generate_relation_graph(obj, highlight_current=True, else: suffix = "" + if full and obj.MAIN_UP_MODEL_QUERY and getattr(obj, + obj.MAIN_UP_MODEL_QUERY): + obj = getattr(obj, obj.MAIN_UP_MODEL_QUERY) + with open(dot_name, "r") as dot_file: django_file = File(dot_file) attr = "relation_dot" + suffix |