[Django] #32565: Extract URL resolver view strings mapping to admindocs

3 views
Skip to first unread message

Django

unread,
Mar 17, 2021, 11:41:41 AM3/17/21
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
------------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (URLs) | Version: dev
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 |
------------------------------------------------+------------------------
From discussion with Nick Pope:
https://github.com/django/django/pull/14138#discussion_r595911054

`URLResolver._is_callback()` , `URLResolver._callback_strs`, and
`URLPattern.lookup_str` all exist only to power `django.contrib.admindocs`
functionality, and are all private attributes. The functionality they
provide could be extracted into `admindocs` to avoid the overhead of
storing extra strings per URL in projects not using admindocs (in my
experience, that is most projects).

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

Django

unread,
Mar 18, 2021, 7:05:27 AM3/18/21
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hmmm 🤔 — internally these are only used by admindocs. I wonder if they're
not being used by tooling somewhere…
([https://twitter.com/carltongibson/status/1372504179642601473 asked ref
PyCharm for an initial data point].)

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

Django

unread,
Mar 18, 2021, 7:31:36 AM3/18/21
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Johnson):

I had the thought that, at the very least, we could make generation lazy.

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

Django

unread,
Mar 18, 2021, 8:40:11 AM3/18/21
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
--------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* stage: Unreviewed => Accepted


Comment:

Negative from PyCharm: they are not using these attributes. And if they’re
not I’m inclined to punt on no-one really is.

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

Django

unread,
Feb 24, 2022, 9:40:47 AM2/24/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
--------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Alokik Roy):

Hi everyone, I would like to work on this ticket and already have started
the process too. But I had one doubt while I was trying to solve the issue
was that the URLreslove._is_callback() functionality also gets used in
tests too. I am new to contributions and wanted to know should I also work
on fixing tests too or just admindocs.py file and resolve.py file only.

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

Django

unread,
Mar 14, 2022, 10:21:16 AM3/14/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned

Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alokik Roy):

* owner: nobody => Alokik Roy
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:5>

Django

unread,
Mar 14, 2022, 12:02:53 PM3/14/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Alokik Roy):

PR
[https://github.com/django/django/pull/15510]

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:6>

Django

unread,
Mar 14, 2022, 12:03:17 PM3/14/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alokik Roy):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:7>

Django

unread,
Mar 15, 2022, 2:15:36 AM3/15/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:8>

Django

unread,
Apr 2, 2022, 6:39:01 AM4/2/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alokik Roy):

* needs_better_patch: 1 => 0


Comment:

Suggested Changes Implemented!

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:9>

Django

unread,
Apr 27, 2022, 5:22:06 AM4/27/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1

* needs_docs: 0 => 1


Comment:

[https://github.com/django/django/pull/15510#pullrequestreview-954585457
Small comments on PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:10>

Django

unread,
Apr 30, 2022, 1:51:09 PM4/30/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alokik Roy):

* needs_better_patch: 1 => 0

* needs_docs: 1 => 0


Comment:

Updated the patch and documented the changes.

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:11>

Django

unread,
May 17, 2022, 3:40:03 AM5/17/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: assigned
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:12>

Django

unread,
May 17, 2022, 4:50:48 AM5/17/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: closed

Component: Core (URLs) | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7f3cfaa12b28d15c0ca78bb692bfd6e59d17bff1" 7f3cfaa1]:
{{{
#!CommitTicketReference repository=""
revision="7f3cfaa12b28d15c0ca78bb692bfd6e59d17bff1"
Fixed #32565 -- Moved internal URLResolver view-strings mapping to
admindocs.

Moved the functionality of URLResolver._is_callback(),
URLResolver._callback_strs, URLPattern.lookup_str() to
django.contrib.admindocs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:13>

Django

unread,
Sep 1, 2022, 3:09:51 PM9/1/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: closed
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"974942a75039ba43e618f6a5ff95e08b5d5176fd" 974942a7]:
{{{
#!CommitTicketReference repository=""
revision="974942a75039ba43e618f6a5ff95e08b5d5176fd"
Fixed #33955, Fixed #33971 -- Reverted "Fixed #32565 -- Moved internal


URLResolver view-strings mapping to admindocs."

This reverts commit 7f3cfaa12b28d15c0ca78bb692bfd6e59d17bff1.

Thanks Tom Carrick and Greg Kaleka for reports.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:14>

Django

unread,
Sep 1, 2022, 3:12:18 PM9/1/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: closed
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"a1083805acc952419752bc8fd860bfda83af42d2" a108380]:
{{{
#!CommitTicketReference repository=""
revision="a1083805acc952419752bc8fd860bfda83af42d2"
[4.1.x] Fixed #33955, Fixed #33971 -- Reverted "Fixed #32565 -- Moved


internal URLResolver view-strings mapping to admindocs."

This reverts commit 7f3cfaa12b28d15c0ca78bb692bfd6e59d17bff1.

Thanks Tom Carrick and Greg Kaleka for reports.

Backport of 974942a75039ba43e618f6a5ff95e08b5d5176fd from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:15>

Django

unread,
Sep 1, 2022, 3:13:22 PM9/1/22
to django-...@googlegroups.com
#32565: Extract URL resolver view strings mapping to admindocs
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Alokik
Type: | Roy
Cleanup/optimization | Status: new
Component: Core (URLs) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted


Comment:

Patch was reverted.

--
Ticket URL: <https://code.djangoproject.com/ticket/32565#comment:16>

Reply all
Reply to author
Forward
0 new messages