MCPcopy
hub / github.com/tortoise/tortoise-orm / annotate

Method annotate

tortoise/models.py:1541–1547  ·  view source on GitHub ↗

Annotates the result set with extra Functions/Aggregations/Expressions. :param kwargs: Parameter name and the Function/Aggregation to annotate with.

(cls, **kwargs: Expression | Term)

Source from the content-addressed store, hash-verified

1539
1540 @classmethod
1541 def annotate(cls, **kwargs: Expression | Term) -> QuerySet[Self]:
1542 """
1543 Annotates the result set with extra Functions/Aggregations/Expressions.
1544
1545 :param kwargs: Parameter name and the Function/Aggregation to annotate with.
1546 """
1547 return cls._meta.manager.get_queryset().annotate(**kwargs)
1548
1549 @classmethod
1550 def all(cls, using_db: BaseDBAsyncClient | None = None) -> QuerySet[Self]:

Calls 1

get_querysetMethod · 0.45