Opened 16 years ago
Closed 16 years ago
#10181 closed (fixed)
Queryset raising EmptyResultSet exception (instead of being empty)
Reported by: | omat | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | EmptyResultSet, ValuesListQuerySet | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
EmptyResultSet exception is fired in 'in' lookups, if the lookup is against an empty ValuesListQuerySet.
>>> ids = Tag.objects.filter(id__in=[]).values_list(id, flat=True) >>> Tag.objects.filter(id__in=ids)
ids is an empty ValuesListQuerySet, as expected. The second line raises EmptyResultSet exception, where I would expect an empty QuerySet instead.
Change History (3)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Summary: | EmptyResultSet exception → Queryset raising EmptyResultSet exception (instead of being empty) |
---|
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Fixed title to be something descriptive.