summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
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