[Django] #32784: django.core.paginator.count should check for method arguments without defaults

5 views
Skip to first unread message

Django

unread,
May 25, 2021, 12:47:30 PM5/25/21
to django-...@googlegroups.com
#32784: django.core.paginator.count should check for method arguments without
defaults
-----------------------------------------+------------------------
Reporter: chdsbd | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Other) | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The count method of the Django Paginator class should allow the QuerySet
count method to have default arguments.

QuerySets with extra arguments will not error when called as long as they
have defaults.


https://github.com/django/django/blob/7e51893911237dfca9294e3ca12163ff813fb656/django/core/paginator.py#L96

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

Django

unread,
May 26, 2021, 4:49:22 AM5/26/21
to django-...@googlegroups.com
#32784: django.core.paginator.count should check for method arguments without
defaults
------------------------------------+--------------------------------------
Reporter: Christopher Dignam | Owner: nobody
Type: Uncategorized | Status: closed

Component: Core (Other) | Version: 3.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => wontfix


Comment:

The property here is intended to work with
[https://docs.djangoproject.com/en/3.2/ref/models/querysets#django.db.models.query.QuerySet.count
QuerySet.count] (and anything that quacks like it). Adjusting that isn't
going to be worth the complication.

The approach would be to subclass `Paginator` in your project to allow
handling your custom `count()` (with arguments) variation.

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

Django

unread,
May 26, 2021, 4:50:13 AM5/26/21
to django-...@googlegroups.com
#32784: django.core.paginator.count should check for method arguments without
defaults
------------------------------------+--------------------------------------
Reporter: Christopher Dignam | Owner: nobody
Type: New feature | Status: closed

Component: Core (Other) | Version: 3.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* type: Uncategorized => New feature


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

Reply all
Reply to author
Forward
0 new messages