diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-18 12:25:56 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-19 14:45:57 +0100 |
commit | 90b65123f6740eb6c5683f92f0c4d304c656c37b (patch) | |
tree | fe3efe470cf390fcd4b7c2bd0c7e1a1c34975405 /archaeological_warehouse | |
parent | b554c71d78ca15fdcbc38e16500f38b8455e5479 (diff) | |
download | Ishtar-90b65123f6740eb6c5683f92f0c4d304c656c37b.tar.bz2 Ishtar-90b65123f6740eb6c5683f92f0c4d304c656c37b.zip |
✨ admin: improve Next/Previous buttons, importer columns - set default importer type and col number
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/models.py | 18 |
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 |