diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 68bc5269c..3e14aa592 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -330,7 +330,8 @@ class BaseFind(BaseHistorizedItem, OwnPerms): return returned @classmethod - def cached_label_bulk_update(cls, operation_id=None, parcel_id=None): + def cached_label_bulk_update(cls, operation_id=None, parcel_id=None, + context_record_id=None): if operation_id: filters = """ INNER JOIN archaeological_context_records_contextrecord acr @@ -345,6 +346,12 @@ class BaseFind(BaseHistorizedItem, OwnPerms): """ args = [int(parcel_id)] kwargs = {'parcel_id': parcel_id} + elif context_record_id: + filters = """ + WHERE mybf.context_record_id = %s + """ + args = [int(context_record_id)] + kwargs = {'context_record_id': context_record_id} else: return @@ -905,7 +912,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): return unicode(self) @classmethod - def cached_label_bulk_update(cls, operation_id=None, parcel_id=None): + def cached_label_bulk_update(cls, operation_id=None, parcel_id=None, + context_record_id=None): if operation_id: filters = """ INNER JOIN find_first_base_find myfbf @@ -926,6 +934,14 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): ON acr.parcel_id = %s AND acr.id = mybf.context_record_id """ args = [int(parcel_id)] + elif context_record_id: + filters = """ + INNER JOIN find_first_base_find myfbf + ON myfbf.find_id = myf.id + INNER JOIN archaeological_finds_basefind mybf + ON myfbf.basefind_id = mybf.id AND mybf.context_record_id = %s + """ + args = [int(parcel_id)] else: return |