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

Method last

tortoise/models.py:1496–1500  ·  view source on GitHub ↗

Generates a QuerySet that returns the last record.

(cls, using_db: BaseDBAsyncClient | None = None)

Source from the content-addressed store, hash-verified

1494
1495 @classmethod
1496 def last(cls, using_db: BaseDBAsyncClient | None = None) -> QuerySetSingle[Self | None]:
1497 """
1498 Generates a QuerySet that returns the last record.
1499 """
1500 return cls._db_queryset(using_db).last()
1501
1502 @classmethod
1503 def filter(cls, *args: Q, **kwargs: Any) -> QuerySet[Self]:

Callers 3

test_lastFunction · 0.45
test_lastFunction · 0.45
test_noid_lastFunction · 0.45

Calls 1

_db_querysetMethod · 0.80

Tested by 3

test_lastFunction · 0.36
test_lastFunction · 0.36
test_noid_lastFunction · 0.36