Opened 2 years ago
Last modified 9 months ago
#32565 new Cleanup/optimization
Extract URL resolver view strings mapping to admindocs
Reported by: | Adam Johnson | Owned by: | Alokik Roy |
---|---|---|---|
Component: | Core (URLs) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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).
Change History (16)
comment:1 Changed 2 years ago by
comment:2 Changed 2 years ago by
I had the thought that, at the very least, we could make generation lazy.
comment:3 Changed 2 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
Negative from PyCharm: they are not using these attributes. And if they’re not I’m inclined to punt on no-one really is.
comment:4 Changed 16 months ago by
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, 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.
comment:5 Changed 15 months ago by
Owner: | changed from nobody to Alokik Roy |
---|---|
Status: | new → assigned |
comment:7 Changed 15 months ago by
Has patch: | set |
---|
comment:8 Changed 15 months ago by
Patch needs improvement: | set |
---|
comment:10 Changed 14 months ago by
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
comment:11 Changed 14 months ago by
Needs documentation: | unset |
---|---|
Patch needs improvement: | unset |
Updated the patch and documented the changes.
comment:12 Changed 13 months ago by
Triage Stage: | Accepted → Ready for checkin |
---|
comment:16 Changed 9 months ago by
Has patch: | unset |
---|---|
Resolution: | fixed |
Status: | closed → new |
Triage Stage: | Ready for checkin → Accepted |
Patch was reverted.
Hmmm 🤔 — internally these are only used by admindocs. I wonder if they're not being used by tooling somewhere… (asked ref PyCharm for an initial data point.)