From 90b65123f6740eb6c5683f92f0c4d304c656c37b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 18 Feb 2025 12:25:56 +0100 Subject: ✨ admin: improve Next/Previous buttons, importer columns - set default importer type and col number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_warehouse/models.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'archaeological_warehouse') 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 -- cgit v1.2.3