Skip to content
Snippets Groups Projects
Commit cea96eee authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: document new filter function

parent 1f2c0023
No related branches found
No related tags found
2 merge requests!175BUG: Request responses without the "Set-Cookie" header no longer overwrite the...,!172ENH: add new member function filter to Container class
Pipeline #59564 passed with warnings
......@@ -78,7 +78,7 @@ Examples
Finding parents and properties
--------
------------------------------
To find a specific parent or property of an Entity, its
ParentList or PropertyList can be filtered using names, ids, or
entities. A short example:
......@@ -126,3 +126,19 @@ entities. A short example:
# Result: [p2_1]
The filter function of ParentList works analogously.
Finding entities in a Container
-------------------------------
In the same way as described above, Container can be filtered.
A short example:
.. code-block:: python3
import linkahead as db
# Setup a record with six properties
p1 = db.Property(id=101, name="Property 1")
p2 = db.Property(name="Property 2")
c = db.Container().extend([p1,p2])
c.filter(name="Property 1")
# Result: [p1]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment