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 | 6acb239f4b18aa91f1fe511f3d3af3d4cb8525e5 (patch) | |
| tree | 31a3cd7a03b652e621653d4deeb0d0f09fa65fe7 /archaeological_operations | |
| parent | 011d53073b6f97379b1afc5b21b00082e8014f4c (diff) | |
| download | Ishtar-6acb239f4b18aa91f1fe511f3d3af3d4cb8525e5.tar.bz2 Ishtar-6acb239f4b18aa91f1fe511f3d3af3d4cb8525e5.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")  | 
