diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-14 17:49:37 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-19 14:43:48 +0100 |
commit | 4f60b4805a7eac04c2a8ec2116a245dbeec3c822 (patch) | |
tree | 561f87e11ae60c96320523c80c6317ff8f1d2f99 /archaeological_files | |
parent | 94f357939957dc8a5de453224913dbecdc4dc9db (diff) | |
download | Ishtar-4f60b4805a7eac04c2a8ec2116a245dbeec3c822.tar.bz2 Ishtar-4f60b4805a7eac04c2a8ec2116a245dbeec3c822.zip |
✨ generate_permissions
manage:
- possession (direct, creation, basket)
- heritage
- areas association
- requests ({USER} special syntax)
Diffstat (limited to 'archaeological_files')
-rw-r--r-- | archaeological_files/models.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 778b1c251..b3815c95d 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -27,7 +27,7 @@ from django.contrib.gis.db import models from django.contrib.postgres.indexes import GinIndex from django.core.cache import cache from django.core.validators import MinValueValidator, MaxValueValidator -from django.db.models import Max +from django.db.models import Q, Max from django.db.models.signals import post_save, m2m_changed, post_delete from django.urls import reverse @@ -41,6 +41,7 @@ from ishtar_common.utils import ( get_current_year, get_generated_id, m2m_historization_changed, + SearchAltName, ) from ishtar_common.models import ( @@ -53,7 +54,6 @@ from ishtar_common.models import ( Person, Organization, Town, - Dashboard, DashboardFormItem, HistoricalRecords, ValueGetter, @@ -62,11 +62,9 @@ from ishtar_common.models import ( post_save_cache, Document, HistoryModel, - SearchAltName, SearchVectorConfig, DocumentItem, CompleteIdentifierItem, - HierarchicalType, ) from archaeological_operations.models import ( @@ -1059,6 +1057,10 @@ class File( return cls @classmethod + def get_limit_to_area_query(cls, town_ids): + return Q(towns__pk__in=town_ids) | Q(main_town_id__in=town_ids) + + @classmethod def get_owns( cls, user, menu_filtr=None, limit=None, values=None, get_short_menu_class=False, no_auth_check=False, query=False |