From 4f60b4805a7eac04c2a8ec2116a245dbeec3c822 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 14 Feb 2025 17:49:37 +0100 Subject: ✨ generate_permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit manage: - possession (direct, creation, basket) - heritage - areas association - requests ({USER} special syntax) --- archaeological_operations/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 2fafa56ed..9e43f264b 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -66,7 +66,6 @@ from ishtar_common.models import ( get_current_profile, document_attached_changed, HistoryModel, - SearchAltName, GeoItem, CompleteIdentifierItem, SearchVectorConfig, @@ -85,6 +84,7 @@ from ishtar_common.utils import ( mode, m2m_historization_changed, post_save_geo, + SearchAltName, SheetItem, ) @@ -850,6 +850,10 @@ class ArchaeologicalSite( ] return actions + @classmethod + def get_limit_to_area_query(cls, town_ids): + return Q(towns__pk__in=town_ids) + @classmethod def _get_query_owns_dicts(cls, ishtaruser, no_rel=False): profile = ishtaruser.current_profile @@ -2308,6 +2312,10 @@ class Operation( return return round(float(self.cost) / self.surface, 2) + @classmethod + def get_limit_to_area_query(cls, town_ids): + return Q(towns__pk__in=town_ids) + @classmethod def _get_query_owns_dicts(cls, ishtaruser, no_rel=False): profile = ishtaruser.current_profile -- cgit v1.2.3