Opened 22 months ago

Closed 21 months ago

Last modified 21 months ago

#34419 closed Cleanup/optimization (fixed)

Document django.contrib.admin.sites.all_sites

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 (7)

comment:1 by Mariusz Felisiak, 22 months ago

Triage Stage: UnreviewedAccepted

comment:2 by Edison Wang, 21 months ago

Owner: changed from nobody to Edison Wang
Status: newassigned

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

comment:4 by Mariusz Felisiak, 21 months ago

Patch needs improvement: set

comment:5 by GitHub <noreply@…>, 21 months ago

Resolution: fixed
Status: assignedclosed

In 255f5345:

Fixed #34419 -- Doc'd django.contrib.admin.sites.all_sites.

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 21 months ago

In 5094013:

[4.2.x] Fixed #34419 -- Doc'd django.contrib.admin.sites.all_sites.

Backport of 255f5345904854128647705adcb8d21138e87c63 from main

comment:7 by Mariusz Felisiak, 21 months ago

Patch needs improvement: unset
Note: See TracTickets for help on using tickets.
Back to Top