#34419: Document django.contrib.admin.sites.all_sites
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Edison
Type: | Wang
Cleanup/optimization | Status: assigned
Component: contrib.admin | 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 Edison Wang):
* has_patch: 0 => 1
Old description:
> #27673 added `all_sites` in django.contrib.admin.sites` as a weak set of
> all sites instnaces. 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.
New description:
#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.
--
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701873b33b772-d7e8228e-ad39-4dc0-a03c-ae780f106e7a-000000%40eu-central-1.amazonses.com.