user_favorites()

Returns the favourites portfolio of a user, or None when there is no unambiguous one.

The favourites portfolio is the one a user created for themselves and that carries the server’s favourites marker in place of a creation time. The lookup therefore matches creator equal to recipient plus exactly that marker.

1. Signature

  • Sync

  • Async

ecm.portfolio.user_favorites(username: str) -> ECMPortfolio | None
await ecm.portfolio.user_favorites(username: str) -> ECMPortfolio | None

2. Parameters

Parameter Type Default Description

username

str

Login name of the user as the server keeps it (usually upper case).

3. Returns

ECMPortfolio or None, including the case where more than one portfolio carries the marker.

4. Example

favorites = ecm.portfolio.user_favorites("ROOT")
if favorites:
    print(f"{len(favorites.objects)} favorites")