[Django] #34419: Document django.contrib.admin.sites.all_sites

1 view
Skip to first unread message

Django

unread,
Mar 17, 2023, 10:13:35 AM3/17/23
to django-...@googlegroups.com
#34419: Document django.contrib.admin.sites.all_sites
------------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
#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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34419>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 18, 2023, 10:02:24 AM3/18/23
to django-...@googlegroups.com
#34419: Document django.contrib.admin.sites.all_sites
--------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:1>

Django

unread,
Mar 29, 2023, 1:05:47 AM3/29/23
to django-...@googlegroups.com
#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: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Edison Wang):

* owner: nobody => Edison Wang
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:2>

Django

unread,
Apr 1, 2023, 1:04:21 AM4/1/23
to django-...@googlegroups.com
#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

unread,
Apr 3, 2023, 1:10:09 AM4/3/23
to django-...@googlegroups.com
#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: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:4>

Django

unread,
Apr 15, 2023, 2:29:29 AM4/15/23
to django-...@googlegroups.com
#34419: Document django.contrib.admin.sites.all_sites
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Edison
Type: | Wang
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"255f5345904854128647705adcb8d21138e87c63" 255f5345]:
{{{
#!CommitTicketReference repository=""
revision="255f5345904854128647705adcb8d21138e87c63"
Fixed #34419 -- Doc'd django.contrib.admin.sites.all_sites.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:5>

Django

unread,
Apr 15, 2023, 2:29:53 AM4/15/23
to django-...@googlegroups.com
#34419: Document django.contrib.admin.sites.all_sites
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Edison
Type: | Wang
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"509401313471ac0e9ef2e0c575c02db4436d6158" 5094013]:
{{{
#!CommitTicketReference repository=""
revision="509401313471ac0e9ef2e0c575c02db4436d6158"
[4.2.x] Fixed #34419 -- Doc'd django.contrib.admin.sites.all_sites.

Backport of 255f5345904854128647705adcb8d21138e87c63 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:6>

Django

unread,
Apr 15, 2023, 2:32:25 AM4/15/23
to django-...@googlegroups.com
#34419: Document django.contrib.admin.sites.all_sites
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Edison
Type: | Wang
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed
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 Mariusz Felisiak):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34419#comment:7>

Reply all
Reply to author
Forward
0 new messages