Opened 8 years ago
Closed 8 years ago
#27636 closed Bug (invalid)
The filter queryset is dynamic?
Description ¶
Here is an example:
q = ModelA.objects.filter(attr=None)
print q
Ans: <QuerySet:[]>
instance1 = ModelA.objects.create()
print q
Ans: <QuerySet:[instance1]>
It seems that the queryset is dynamic and vary with the model. Is this a bug or not?
Note:
See TracTickets
for help on using tickets.
This is not a bug, it's documented behavior, see: https://docs.djangoproject.com/en/dev/ref/models/querysets/#when-querysets-are-evaluated
(In the future please ask questions on the django-users mailing list: https://groups.google.com/forum/#!forum/django-users rather than opening a ticket in the bug tracker.)