create()
Creates a portfolio and returns it, fully read back, as ECMPortfolio.
1. Signature
-
Sync
-
Async
ecm.portfolio.create(*, creator: str | None = None, recipient: str | None = None,
subject: str | None = None,
objects: Iterable[ECMPortfolioObjectLike] | None = None,
object_type_id: int | None = None,
reuse_existing: bool = False) -> ECMPortfolio
await ecm.portfolio.create(...) -> ECMPortfolio
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
|
Login name of the creator. |
|
|
|
Login name of the recipient, for a portfolio handed to someone else. |
|
|
|
Title of the portfolio. The backing column holds 32 characters; what happens to longer values is up to the server. |
|
|
|
Initial content. Accepted are |
|
|
|
Restrict the portfolio to this object type. The server then rejects members of other types. |
|
|
|
|
3. Returns
The created or reused ECMPortfolio.
| Subject, recipient and object type of an existing portfolio cannot be changed later, the server API has no job for it. Renaming means deleting and creating anew. |
5. Example
portfolio = ecm.portfolio.create(
creator="ROOT",
recipient="ROOT",
subject="Follow-up week 34",
objects=[(83, 262144)],
)
print(portfolio.id, portfolio.created)
# Idempotent: only the first call creates
portfolio = ecm.portfolio.create(recipient="ROOT", subject="Follow-up", reuse_existing=True)
6. Related pages
-
add_objects() — extend the content of an existing portfolio
-
delete() — delete a portfolio