Returns the earliest object by ordering ascending on the specified field. :params orderings: Fields to order by. :raises FieldError: If unknown or no fields has been provided.
(self, *orderings: str)
| 501 | return queryset._as_single() |
| 502 | |
| 503 | def earliest(self, *orderings: str) -> QuerySetSingle[MODEL | None]: |
| 504 | """ |
| 505 | Returns the earliest object by ordering ascending on the specified field. |
| 506 | |
| 507 | :params orderings: Fields to order by. |
| 508 | |
| 509 | :raises FieldError: If unknown or no fields has been provided. |
| 510 | """ |
| 511 | if not orderings: |
| 512 | raise FieldError("No fields passed") |
| 513 | queryset = self._clone() |
| 514 | queryset._orderings = self._parse_orderings(orderings) |
| 515 | return queryset._as_single() |
| 516 | |
| 517 | def limit(self, limit: int) -> QuerySet[MODEL]: |
| 518 | """ |
nothing calls this directly
no test coverage detected