[Django] #23722: Empty QuerySet return error after performing qs.none().count()

8 views
Skip to first unread message

Django

unread,
Oct 28, 2014, 3:28:41 AM10/28/14
to django-...@googlegroups.com
#23722: Empty QuerySet return error after performing qs.none().count()
----------------------------------------------+---------------------------
Reporter: vasyabigi | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.7
Severity: Normal | Keywords: queryset, sql
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+---------------------------
{{{
obj.add_count_column()
number = obj.get_aggregation(using=using)[None]

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

KeyError: None
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23722>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 28, 2014, 3:40:04 AM10/28/14
to django-...@googlegroups.com
#23722: Empty QuerySet return error after performing qs.none().count()
-------------------------------------+-------------------------------------
Reporter: vasyabigi | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.7
(models, ORM) | Resolution: needsinfo
Severity: Normal | Triage Stage:
Keywords: queryset, sql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by akaariai):

* status: new => closed
* needs_docs: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

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?

--
Ticket URL: <https://code.djangoproject.com/ticket/23722#comment:1>

Django

unread,
Oct 28, 2014, 3:48:18 AM10/28/14
to django-...@googlegroups.com
#23722: Empty QuerySet return error after performing qs.none().count()
-------------------------------------+-------------------------------------
Reporter: vasyabigi | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.7
(models, ORM) | Resolution: needsinfo
Severity: Normal | Triage Stage:
Keywords: queryset, sql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by vasyabigi):

Sure,

All you need to do is next:

{{{
User.objects.none().count()
}}}

where `User` could be any other model from the app.

--
Ticket URL: <https://code.djangoproject.com/ticket/23722#comment:2>

Django

unread,
Oct 28, 2014, 4:03:20 AM10/28/14
to django-...@googlegroups.com
#23722: Empty QuerySet return error after performing qs.none().count()
-------------------------------------+-------------------------------------
Reporter: vasyabigi | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.7
(models, ORM) | Resolution: needsinfo
Severity: Normal | Triage Stage:
Keywords: queryset, sql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by akaariai):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/23722#comment:3>

Django

unread,
Oct 28, 2014, 7:05:55 AM10/28/14
to django-...@googlegroups.com
#23722: Empty QuerySet return error after performing qs.none().count()
-------------------------------------+-------------------------------------
Reporter: vasyabigi | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.7
(models, ORM) | Resolution: invalid

Severity: Normal | Triage Stage:
Keywords: queryset, sql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vasyabigi):

* resolution: needsinfo => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/23722#comment:4>

Reply all
Reply to author
Forward
0 new messages