summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-09-29 02:43:19 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-09-29 02:43:19 +0200
commitdf2405cb949e268dda4c880d2685054c0eab4a80 (patch)
treee27f01bf29b9fe16dfccc157f2a1f2d6fcb872e4 /archaeological_operations/models.py
parentfa03f91834500f7589ba1912a681227186d7974e (diff)
downloadIshtar-df2405cb949e268dda4c880d2685054c0eab4a80.tar.bz2
Ishtar-df2405cb949e268dda4c880d2685054c0eab4a80.zip
Display dynamicaly large tables in windows
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 977fbdb4a..90af1bd62 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -36,6 +36,7 @@ from ishtar_common.models import GeneralType, BaseHistorizedItem, \
DocumentTemplate, ShortMenuItem, DashboardFormItem, GeneralRelationType,\
GeneralRecordRelations, post_delete_record_relation
FILES_AVAILABLE = 'archaeological_files' in settings.INSTALLED_APPS
+FINDS_AVAILABLE = 'archaeological_finds' in settings.INSTALLED_APPS
class OperationType(GeneralType):
@@ -306,6 +307,17 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
def show_url(self):
return reverse('show-operation', args=[self.pk, ''])
+ def has_finds(self):
+ if not FINDS_AVAILABLE:
+ return
+ from archaeological_finds.models import BaseFind
+ return BaseFind.objects.filter(context_record__operation=self).count()
+
+ def finds(self):
+ if FINDS_AVAILABLE:
+ from archaeological_finds.models import BaseFind
+ return BaseFind.objects.filter(context_record__operation=self)
+
def get_reference(self, full=False):
ref = ""
if self.code_patriarche: