Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23722 closed Bug (invalid)

Empty QuerySet return error after performing qs.none().count()

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

Description

obj.add_count_column()
number = obj.get_aggregation(using=using)[None]

# Apply offset and limit constraints manually, since using LIMIT/OFFSET

KeyError: None

Change History (4)

comment:1 by Anssi Kääriäinen, 10 years ago

Resolution: needsinfo
Status: newclosed

The description doesn't contain enough information of how to reproduce the error you are seeing. Could you elaborate on how to produce the error by using public APIs?

comment:2 by Vasyl Stanislavchuk, 10 years ago

Sure,

All you need to do is next:

User.objects.none().count()

where User could be any other model from the app.

comment:3 by Anssi Kääriäinen, 10 years ago

Sorry, I still don't know how to reproduce. Could you give the full sequence of steps to reproduce this error.

comment:4 by Vasyl Stanislavchuk, 10 years ago

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