Opened 21 months ago
Last modified 20 months ago
#34419 closed Cleanup/optimization
Document django.contrib.admin.sites.all_sites — at Version 3
Reported by: | Adam Johnson | Owned by: | Edison Wang |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
#27673 added all_sites
in django.contrib.admin.sites` as a weak set of all sites instances. It's used by system checks to loop over all current site instances.
This set is also useful for custom checks and tests across all admin sites. For example, the parameterized test I just blogged about: https://adamj.eu/tech/2023/03/17/django-parameterized-tests-model-admin-classes/ .
all_sites
has been stable since 2017. I suggest that we document it, so that it’s a public API that such custom checks and tests can rely on.
Change History (3)
comment:1 by , 20 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 20 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 20 months ago
Description: | modified (diff) |
---|---|
Has patch: | set |
https://github.com/django/django/pull/16712
I fixed a typo in the ticket. Also, I'm unsure about the formatting for the documentation, but the content should be good. Please check so I can revise if needed.