Opened 6 years ago

Closed 6 years ago

#27636 closed Bug (invalid)

The filter queryset is dynamic?

Reported by: renpj Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Normal Keywords: queryset
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

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?

Change History (1)

comment:1 Changed 6 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

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.)

Note: See TracTickets for help on using tickets.
Back to Top