summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-07-08 12:11:24 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-07-08 12:11:24 +0200
commit5bc2404d0df8662ddebaf785751eff2c82b68a9f (patch)
treeb91e67d5beb271ba3bfc8a059dddab74d4fc7c53 /ishtar_common
parenta9b0c688f57f676f90dd27fb65520d2e1ad92f64 (diff)
downloadIshtar-5bc2404d0df8662ddebaf785751eff2c82b68a9f.tar.bz2
Ishtar-5bc2404d0df8662ddebaf785751eff2c82b68a9f.zip
Graph generation: refactor view - add an option in profile
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/migrations/0099_ishtarsiteprofile_relation_graph.py20
-rw-r--r--ishtar_common/models.py9
-rw-r--r--ishtar_common/views_item.py2
3 files changed, 28 insertions, 3 deletions
diff --git a/ishtar_common/migrations/0099_ishtarsiteprofile_relation_graph.py b/ishtar_common/migrations/0099_ishtarsiteprofile_relation_graph.py
new file mode 100644
index 000000000..95c0df133
--- /dev/null
+++ b/ishtar_common/migrations/0099_ishtarsiteprofile_relation_graph.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.18 on 2019-07-08 10:12
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0098_ishtarsiteprofile_point_precision'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='relation_graph',
+ field=models.BooleanField(default=False, verbose_name='Generate relation graph'),
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index e8b6fc518..b2f235207 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1241,8 +1241,11 @@ class RelationItem(models.Model):
class Meta:
abstract = True
- def generate_relation_image(self):
- generate_relation_graph(self)
+ def generate_relation_image(self, highlight_current=True,
+ render_above=True, render_bellow=True):
+ generate_relation_graph(self, highlight_current=highlight_current,
+ render_above=render_above,
+ render_bellow=render_bellow)
class JsonDataSection(models.Model):
@@ -2633,6 +2636,8 @@ class IshtarSiteProfile(models.Model, Cached):
)
use_town_for_geo = models.BooleanField(
_("Use town to locate when coordinates are missing"), default=True)
+ relation_graph = models.BooleanField(_("Generate relation graph"),
+ default=False)
underwater = models.BooleanField(_("Underwater module"), default=False)
parcel_mandatory = models.BooleanField(
_("Parcel are mandatory for context records"), default=True)
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py
index 799292969..40f74396f 100644
--- a/ishtar_common/views_item.py
+++ b/ishtar_common/views_item.py
@@ -202,7 +202,7 @@ def show_item(model, name, extra_dct=None, model_for_perms=None):
dct['PROFILE'] = profile
dct['CURRENCY'] = profile.currency
dct['ENCODING'] = settings.ENCODING
- dct['DOT_GENERATION'] = settings.DOT_BINARY and True
+ dct['DOT_GENERATION'] = settings.DOT_BINARY and profile.relation_graph
dct['current_window_url'] = url_name
date = None
if 'date' in dct: