prefetch
Prefetch attaches a queryset to a prefetched relation, so the related models
are filtered, ordered and narrowed to selected fields while they are loaded::
| Text Only | |
|---|---|
1 2 3 | |
Prefetch
dataclass
A relation to prefetch together with the queryset its models are loaded with.
Attributes:
| Name | Type | Description |
|---|---|---|
relation |
str
|
relation path, the same |
queryset |
QuerySet[Any]
|
queryset of the related model; its filters, excludes,
ordering and |
Source code in ormar/queryset/prefetch.py
| Python | |
|---|---|
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |