-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
The result returned by some QuerySet
methods do not allow chaining with other methods due to their form. For example, the result of a value_list
will not allow operations like order_by
.
Any QuerySet
method which returns a result where the items are not Model
instances qualify to return instances of type LimitedQuerySet
.
Example use case:
>>> Foo.objects.filter(...).values_list('pk', 'name', 'idx')
[(123, 'A', 0,), (124, 'B', 1,), ...] # LimitedQuerySet
>>> Foo.objects.filter(...).values_list('pk', 'name', 'idx').map(lambda c: hash(c))
[-8396369143964016954, 3966759431255512253, ...] # LimitedQuerySet