summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2013-07-16 23:28:25 +0000
committerÉtienne Loks <etienne.loks@proxience.com>2013-07-16 23:28:25 +0000
commit748940e2a215bf62adb0e61647d117c94dceb708 (patch)
tree0eb9903217350f33513d97b6ddf4d4e4126c332f /archaeological_finds/models.py
parent23e4ba7b12751cf481015e68e1336dd5bb1042f0 (diff)
parent06824fcb9a58226cb017ae5104aefa48874754f6 (diff)
downloadIshtar-748940e2a215bf62adb0e61647d117c94dceb708.tar.bz2
Ishtar-748940e2a215bf62adb0e61647d117c94dceb708.zip
Merge branch 'master' of lysithea.proxience.net:/home/proxience/git/ishtar
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 9c1e72e38..c7ed9083e 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -32,6 +32,7 @@ if WAREHOUSE_AVAILABLE:
from archaeological_warehouse.models import Warehouse, Container
class MaterialType(GeneralType):
+ code = models.CharField(_(u"Code"), max_length=10, blank=True, null=True)
recommendation = models.TextField(_(u"Recommendation"))
parent = models.ForeignKey("MaterialType", blank=True, null=True,
verbose_name=_(u"Parent material"))
@@ -71,11 +72,11 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
return finds and finds[0]
def full_label(self):
- return self._real_label() or self._temp_label()
+ return self._real_label() or self._temp_label() or u""
def material_type_label(self):
find = self.get_last_find()
- finds = [find and unicode(find.material_type) or '']
+ finds = [find and find.material_type.code or '']
ope = self.context_record.operation
finds += [ope.code_patriarche or \
(unicode(ope.year) + "-" + unicode(ope.operation_code))]