core (memory/sqla): searchPubsubItems can now filter on item names
This commit is contained in:
parent
75684953be
commit
c678f1f993
1 changed files with 7 additions and 0 deletions
|
|
@ -1425,6 +1425,8 @@ class Storage:
|
|||
:subtypes (list[str|None]):
|
||||
filter on nodes with those subtypes. None can be used to filter on nodes with
|
||||
no subtype set
|
||||
:names (list[str]):
|
||||
filter on items with those names
|
||||
:parsed (list[dict]):
|
||||
Filter on a parsed data field. The dict must contain 3 keys: ``path``
|
||||
which is a list of str or int giving the path to the field of interest
|
||||
|
|
@ -1511,6 +1513,11 @@ class Storage:
|
|||
else:
|
||||
stmt = stmt.options(selectinload(PubsubItem.node))
|
||||
|
||||
# names
|
||||
names = query.get("names")
|
||||
if names:
|
||||
stmt = stmt.where(PubsubItem.name.in_(names))
|
||||
|
||||
# parsed data filters
|
||||
parsed = query.get("parsed", [])
|
||||
for filter_ in parsed:
|
||||
|
|
|
|||
Loading…
Reference in a new issue