summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 19:31:45 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 19:31:45 +0100
commit5889915d68867862c2f37866e8f8bf949c01e06e (patch)
treee2d718346323d03543af43ec1b32e5d38621866e /archaeological_finds
parent6b5ac2a50430316d82cf1758c895757b50232917 (diff)
downloadIshtar-5889915d68867862c2f37866e8f8bf949c01e06e.tar.bz2
Ishtar-5889915d68867862c2f37866e8f8bf949c01e06e.zip
Templates: list all dependant documents
New template tags for displaying table of documents
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index f694ed562..53af78f8b 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -19,6 +19,7 @@
from django.conf import settings
from django.contrib.gis.db import models
+from django.core.urlresolvers import reverse
from django.db.models import Max
from django.utils.translation import ugettext_lazy as _, ugettext
@@ -197,6 +198,14 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms):
def __unicode__(self):
return self.label
+ @property
+ def short_label(self):
+ return self.reference
+
+ @property
+ def show_url(self):
+ return reverse('show-find', args=[self.pk, ''])
+
def get_first_base_find(self):
q= self.base_finds
if not q.count():
@@ -300,6 +309,10 @@ class FindSource(Source):
find = models.ForeignKey(Find, verbose_name=_(u"Find"),
related_name="source")
+ @property
+ def owner(self):
+ return self.find
+
class TreatmentType(GeneralType):
virtual = models.BooleanField(_(u"Virtual"))
class Meta:
@@ -346,6 +359,10 @@ class TreatmentSource(Source):
treatment = models.ForeignKey(Treatment, verbose_name=_(u"Treatment"),
related_name="source")
+ @property
+ def owner(self):
+ return self.treatment
+
class Property(LightHistorizedItem):
find = models.ForeignKey(Find, verbose_name=_(u"Find"))
administrative_act = models.ForeignKey(AdministrativeAct,