summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index aa97e412a..be4349121 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -75,14 +75,14 @@ class DivisionContainer(DashboardFormItem):
@property
def pk(self):
# of course implemented by models.Model
- raise NotImplemented
+ raise NotImplementedError()
def get_max_division_number(self):
- raise NotImplemented
+ raise NotImplementedError()
@property
def start_division_number(self):
- raise NotImplemented
+ raise NotImplementedError()
@property
def division_labels(self):
@@ -812,8 +812,8 @@ class ContainerTree(models.Model):
WHERE c.parent_id is NOT NULL
UNION ALL
SELECT p.container_id AS container_id,
- c.parent_id as container_parent_id,
- p.level + 1
+ c.parent_id as container_parent_id,
+ p.level + 1
FROM archaeological_warehouse_container c, rel_tree p
WHERE c.id = p.container_parent_id
AND c.parent_id is NOT NULL
@@ -1291,7 +1291,9 @@ class Container(
return self.cached_label or ""
def post_save_geo(self, save=True):
- q_check_town = Warehouse.objects.filter(pk=self.location_id, precise_town_id__isnull=False)
+ q_check_town = Warehouse.objects.filter(
+ pk=self.location_id, precise_town_id__isnull=False
+ )
return warehouse_post_save_geo(self, q_check_town, save=save)
@property
@@ -1391,7 +1393,9 @@ class Container(
if not self.pk:
return False
if self.calculated_weight != self._calculate_weight():
- Container.objects.filter(pk=self.pk).update(calculated_weight=self.calculated_weight)
+ Container.objects.filter(pk=self.pk).update(
+ calculated_weight=self.calculated_weight
+ )
return True
return False