diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-24 19:39:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-24 19:39:53 +0100 |
commit | f394393163ee9a4789f2f69c6a68fce4369413db (patch) | |
tree | 31a3cd7a03b652e621653d4deeb0d0f09fa65fe7 /archaeological_operations | |
parent | ba02a4cd0672b6458cacae7cf127df9d90c49caf (diff) | |
download | Ishtar-f394393163ee9a4789f2f69c6a68fce4369413db.tar.bz2 Ishtar-f394393163ee9a4789f2f69c6a68fce4369413db.zip |
Document templates: add town values for archaeological operations and archaeological files
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 6a90b92b7..ae50b1a28 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -189,6 +189,15 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter): self.save() return self.cached_label + def get_values(self, prefix=''): + values = super(Operation, self).get_values(prefix=prefix) + values[prefix+'towns'] = '' + values[prefix+'towns_count'] = unicode(self.towns.count()) + if self.towns.count(): + values[prefix+'towns'] = u", ".join([town.name + for town in self.towns.all().order_by('name')]) + return values + @property def short_class_name(self): return _(u"OPE") |