reciprocals

This commit is contained in:
2021-02-07 22:12:58 +01:00
parent cd82d5465a
commit d8bfc19986
3 changed files with 41 additions and 10 deletions
+12 -2
View File
@@ -39,13 +39,12 @@
</ul>
{% endif %}
{% if model.relations %}
Relations:
<ul>
{% for rel in model.relations %}
<li>
<span title="{{rel.model.id}}">"{{rel.model.name}}", pointing to: <i>{{rel.related_name}}</i> (reciprocal as "{{rel.model.reciprocal_name}}")</span>
<span title="{{rel.model.id}}">"{{rel.model.name}}" -&gt; <i>{{rel.related_name}} (reciprocally as "{{rel.model.reciprocal_name}}")</i></span>
{%- if rel.model.optional %}, OPTIONAL{% endif %}
{%- if rel.model.multiple %}, MULTIPLE{% endif %}
<br>
@@ -68,6 +67,17 @@
{% endfor %}
</ul>
{% endif %}
{% if model.reciprocal_relations %}
Incoming relations:
<ul>
{% for rel in model.reciprocal_relations %}
<li>
<span title="{{rel.model.id}}">"{{rel.model.reciprocal_name}}" &lt;- <i>{{rel.related_name}}</i> (reciprocally as "{{rel.model.name}}")</span>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>