backoffice: don't get full objects when looking for ids (#38966)
This commit is contained in:
parent
efa3ebb305
commit
36b58079b9
|
@ -160,7 +160,7 @@ class FormDefUI(object):
|
|||
item_ids = list(set(item_ids).intersection(query_ids))
|
||||
|
||||
if criterias:
|
||||
select_ids = [x.id for x in formdata_class.select(clause=criterias)]
|
||||
select_ids = formdata_class.keys(clause=criterias)
|
||||
item_ids = list(set(item_ids).intersection(select_ids))
|
||||
|
||||
if item_ids and not anonymise:
|
||||
|
|
|
@ -286,9 +286,11 @@ class StorableObject(object):
|
|||
return os.path.join(get_publisher().app_dir, cls.get_table_name())
|
||||
|
||||
@classmethod
|
||||
def keys(cls):
|
||||
def keys(cls, clause=None):
|
||||
if not os.path.exists(cls.get_objects_dir()):
|
||||
return []
|
||||
if clause:
|
||||
return [x.id for x in cls.select(clause=clause)]
|
||||
return [fix_key(x) for x in os.listdir(cls.get_objects_dir()) if x[0] != '.']
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue