Opened 14 months ago

Last modified 13 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 Edison Wang)

#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 Mariusz Felisiak, 14 months ago

Triage Stage: UnreviewedAccepted

comment:2 by Edison Wang, 14 months ago

Owner: changed from nobody to Edison Wang
Status: newassigned

comment:3 by Edison Wang, 14 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.

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