Opened 21 months ago

Last modified 20 months ago

#34419 closed Cleanup/optimization

Document django.contrib.admin.sites.all_sites — at Initial Version

Reported by: Adam Johnson Owned by: nobody
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

#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.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top