summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-22 18:25:53 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-22 18:37:29 +0200
commitce71152fcae3a25b9cadfd8a4a561829e3296d3c (patch)
tree5d49cc534771a2ec84d8bd33a01fda83aaee1787 /archaeological_files/models.py
parent8b116164320adbcefab1f5a10a4a401f897ef578 (diff)
downloadIshtar-ce71152fcae3a25b9cadfd8a4a561829e3296d3c.tar.bz2
Ishtar-ce71152fcae3a25b9cadfd8a4a561829e3296d3c.zip
Operations - archaeological files: fix closing info (refs #3175)
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r--archaeological_files/models.py19
1 files changed, 4 insertions, 15 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 9709824df..1cfbe35d3 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -33,7 +33,8 @@ from ishtar_common.models import GeneralType, BaseHistorizedItem, \
Dashboard, DashboardFormItem, IshtarUser, ValueGetter, ShortMenuItem, \
OperationType, get_external_id
-from archaeological_operations.models import get_values_town_related
+from archaeological_operations.models import get_values_town_related, \
+ ClosedItem
class FileType(GeneralType):
@@ -68,8 +69,8 @@ if settings.COUNTRY == 'fr':
ordering = ('label',)
-class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
- DashboardFormItem):
+class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,
+ ShortMenuItem, DashboardFormItem):
TABLE_COLS = ['numeric_reference', 'year', 'internal_reference',
'file_type', 'saisine_type', 'towns', ]
year = models.IntegerField(_(u"Year"),
@@ -396,18 +397,6 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
def town_list(self):
return u", ".join([unicode(tw) for tw in self.towns.all()])
- def closing(self):
- if self.is_active():
- return
- q = self.history
- if not q.count():
- return {'date': None, 'user': None}
- for item in q.all():
- if not item.end_date:
- break
- return {'date': item.history_date,
- 'user': IshtarUser.objects.get(pk=item.history_modifier_id)}
-
def total_surface_ha(self):
if self.total_surface:
return self.total_surface / 10000.0