search()
Searches portfolios and returns them as list[ECMPortfolio]. All criteria are optional and
combine as an AND; without any criterion every portfolio visible to the session is returned.
1. Signature
-
Sync
-
Async
ecm.portfolio.search(*, portfolio_id: int | None = None, creator: str | None = None,
recipient: str | None = None, subject: str | None = None,
created: datetime | None = None, created_to: datetime | None = None,
object_type_id: int | None = None,
garbage_mode: bool = False) -> list[ECMPortfolio]
await ecm.portfolio.search(...) -> list[ECMPortfolio]
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
|
ID of a single portfolio. For single access get() is more convenient. |
|
|
|
Login name of the creator. |
|
|
|
Login name of the recipient. |
|
|
|
Title of the portfolio. |
|
|
|
Exact creation time, read as installation wall clock. |
|
|
|
Upper bound for the creation time. |
|
|
|
Only portfolios restricted to this object type. |
|
|
|
|
3. Returns
list[ECMPortfolio], empty when nothing matches. Fields see overview.
4. Example
from datetime import datetime
# All portfolios of one creator
mine = ecm.portfolio.search(creator="ROOT")
# Find older portfolios for cleanup
old = ecm.portfolio.search(creator="ROOT", created_to=datetime(2024, 1, 1))
# Deleted portfolios in the recycle bin
deleted = ecm.portfolio.search(creator="ROOT", garbage_mode=True)
for portfolio in mine:
print(portfolio.id, portfolio.subject, len(portfolio.objects))
5. Related pages
-
get() — a single portfolio by its ID
-
user_favorites() — the favourites portfolio of a user