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

Method earliest

tortoise/models.py:1522–1528  ·  view source on GitHub ↗

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

(cls, *orderings: str)

Source from the content-addressed store, hash-verified

1520
1521 @classmethod
1522 def earliest(cls, *orderings: str) -> QuerySetSingle[Self | None]:
1523 """
1524 Generates a QuerySet with the filter applied that returns the first record.
1525
1526 :params orderings: Fields to order by.
1527 """
1528 return cls._meta.manager.get_queryset().earliest(*orderings)
1529
1530 @classmethod
1531 def exclude(cls, *args: Q, **kwargs: Any) -> QuerySet[Self]:

Callers 4

test_earliestFunction · 0.45
test_earliestFunction · 0.45
test_noid_earliestFunction · 0.45
test_earliestFunction · 0.45

Calls 1

get_querysetMethod · 0.45

Tested by 4

test_earliestFunction · 0.36
test_earliestFunction · 0.36
test_noid_earliestFunction · 0.36
test_earliestFunction · 0.36