# HG changeset patch # User Goffi # Date 1652457757 -7200 # Node ID af485e8afe032157a054c466f584b055e611d2f3 # Parent 10b71e3526bdc6e4c2957a97f46c61b2186e3fed core (memory/sqla): `searchPubsubItems` can now filter on item names diff -r 10b71e3526bd -r af485e8afe03 sat/memory/sqla.py --- a/sat/memory/sqla.py Fri May 13 17:58:51 2022 +0200 +++ b/sat/memory/sqla.py Fri May 13 18:02:37 2022 +0200 @@ -1425,6 +1425,8 @@ :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 @@ 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: