MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / latest

Method latest

tortoise/models.py:1513–1519  ·  view source on GitHub ↗

Generates a QuerySet with the filter applied that returns the last record. :params orderings: Fields to order by.

(cls, *orderings: str)

Source from the content-addressed store, hash-verified

1511
1512 @classmethod
1513 def latest(cls, *orderings: str) -> QuerySetSingle[Self | None]:
1514 """
1515 Generates a QuerySet with the filter applied that returns the last record.
1516
1517 :params orderings: Fields to order by.
1518 """
1519 return cls._meta.manager.get_queryset().latest(*orderings)
1520
1521 @classmethod
1522 def earliest(cls, *orderings: str) -> QuerySetSingle[Self | None]:

Callers 4

test_latestFunction · 0.45
test_latestFunction · 0.45
test_noid_latestFunction · 0.45
test_latestFunction · 0.45

Calls 1

get_querysetMethod · 0.45

Tested by 4

test_latestFunction · 0.36
test_latestFunction · 0.36
test_noid_latestFunction · 0.36
test_latestFunction · 0.36