summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-29 15:39:44 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-29 15:39:44 +0200
commite30953a0f8476142561c390fedb160dafc745cb9 (patch)
tree2b85c3e81e5b7849c962502fbe1d654094443865 /archaeological_operations
parenta182b1c190020f1204cd0cb3918c5d1e9d2ce8c4 (diff)
downloadIshtar-e30953a0f8476142561c390fedb160dafc745cb9.tar.bz2
Ishtar-e30953a0f8476142561c390fedb160dafc745cb9.zip
Make all "short_label" properties (refs #1370)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/models.py3
-rw-r--r--archaeological_operations/wizards.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 6619bc72e..35dc8c20c 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -383,12 +383,13 @@ class Parcel(LightHistorizedItem):
verbose_name = _(u"Parcel")
verbose_name_plural = _(u"Parcels")
+ @property
def short_label(self):
return settings.JOINT.join([unicode(item) for item in [self.section,
self.parcel_number] if item])
def __unicode__(self):
- return self.short_label()
+ return self.short_label
@staticmethod
def grouped_parcels(parcels):
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 419cac895..d24b380dd 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -100,7 +100,7 @@ class OperationWizard(Wizard):
try:
for parcel in models.File.objects.get(pk=int(file_id)
).parcels.all():
- parcels.append((parcel.pk, parcel.short_label()))
+ parcels.append((parcel.pk, parcel.short_label))
except (ValueError, ObjectDoesNotExist):
pass
data['PARCELS'] = sorted(parcels, key=lambda x:x[1])