diff options
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 5 |
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))] |