[Django] #24553: Pass application list to more admin views

15 views
Skip to first unread message

Django

unread,
Mar 30, 2015, 8:51:17 AM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------
Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords: admin
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Pass the list of available applications to more views so it is possible to
show a menu with them.

Discussion on list:
https://groups.google.com/forum/#!searchin/django-
developers/having$20the$20app/django-developers/SLwh7zJmkTQ/RPUABdNYuCIJ

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

Django

unread,
Mar 30, 2015, 9:07:23 AM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Pull request:
https://github.com/django/django/pull/4410

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

Django

unread,
Mar 30, 2015, 9:20:24 AM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timgraham):

It might be a use case for `AdminSite.each_context()`. Could we merely add
the `AdminSite.get_app_list()` method (called `build_app_list()` in your
patch) and allow users to override `AdminSite.each_context()` if they want
that available in all their contexts?

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

Django

unread,
Mar 30, 2015, 9:24:05 AM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:3>

Django

unread,
Mar 30, 2015, 9:33:00 AM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by rm_):

Replying to [comment:2 timgraham]:


> It might be a use case for `AdminSite.each_context()`. Could we merely
add the `AdminSite.get_app_list()` method (called `build_app_list()` in
your patch) and allow users to override `AdminSite.each_context()` if they
want that available in all their contexts?

My plan is to consume this data on django theme and really much like to
have it work out of the box without requiring user intervention. If that's
not possible i'll go with the each_context() route.

Settings needs better patch because some tests are failing.

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

Django

unread,
Mar 30, 2015, 1:43:46 PM3/30/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+--------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


Comment:

Tests passes, the docs test not passing i think is not related to the
patchset as in some runs it did pass. One thing i am wondering about is to
don't call build_app_list() if is_popup() is true since it does not make
much sense to add it inside a popup. Flipping the needs improvement bits
to get some review exposure. What do you think?

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

Django

unread,
Apr 1, 2015, 7:43:29 AM4/1/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted

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

* stage: Unreviewed => Accepted


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

Django

unread,
May 6, 2015, 8:33:57 AM5/6/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


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

Django

unread,
May 6, 2015, 1:02:56 PM5/6/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:8>

Django

unread,
May 6, 2015, 1:24:16 PM5/6/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------------+-------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:9>

Django

unread,
May 11, 2015, 12:08:33 PM5/11/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------------+-------------------------------------
Reporter: rm_ | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: admin | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"bd53db5eab05099ae371348529c6428e0da95c6a" bd53db5]:
{{{
#!CommitTicketReference repository=""
revision="bd53db5eab05099ae371348529c6428e0da95c6a"
Fixed #24553 -- Added the list of available applications to
AdminSite.each_context()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:10>

Django

unread,
May 13, 2015, 10:18:22 PM5/13/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted


Comment:

Reopening due to test failures reported in #24798.

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:11>

Django

unread,
May 14, 2015, 8:37:30 AM5/14/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by rm_):

* has_patch: 0 => 1


Comment:

Opened pull request here:
https://github.com/django/django/pull/4659

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:12>

Django

unread,
May 14, 2015, 9:57:45 AM5/14/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"adf5d75af1418b044d7ea335896e75277da06b77" adf5d75a]:
{{{
#!CommitTicketReference repository=""
revision="adf5d75af1418b044d7ea335896e75277da06b77"
Refs #24553 -- Isolated admin_* tests.

This fixes a regression with runtests.py --reverse after
bd53db5eab05099ae371348529c6428e0da95c6a

We need to avoid leaking model registration in the default AdminSite.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:13>

Django

unread,
May 14, 2015, 9:59:34 AM5/14/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------
Reporter: rm_ | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:14>

Django

unread,
May 17, 2015, 8:35:40 PM5/17/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: admin | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* status: closed => new


* has_patch: 1 => 0
* resolution: fixed =>


Comment:

Still seeing two test failures with `$ ./runtests.py auth_tests`

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:15>

Django

unread,
May 18, 2015, 6:34:00 AM5/18/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by rm_):

Looking into this, it looks like all the test without custom AdminSite
leaks auth models in the site breaking the two test classes using custom
ROOT_URLCONF that are failing.

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:16>

Django

unread,
May 18, 2015, 1:56:19 PM5/18/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by timgraham):

There appears to be leakage of the URLs from `tests/auth_tests/urls.py`
into tests that use `ROOT_URLCONF='auth_tests.test_urls_admin'`. Couldn't
find the reason for this but traced it as far as
[https://github.com/django/django/blob/1046c8afecf719eee5a2aaa28b001e731f94100b/django/core/urlresolvers.py#L405-L410
RegexURLResolver.urlconf_module] which shows leakage with this version:
{{{
#!python
@property
def urlconf_module(self):
if isinstance(self.urlconf_name, six.string_types):
module = import_module(self.urlconf_name)
patterns = getattr(module, "urlpatterns")
print('---- %s ---- %s ' % (self.urlconf_name, patterns))
return module
else:
return self.urlconf_name
}}}

and:

`$ ./tests/runtests.py
auth_tests.test_views.ChangePasswordTest.test_password_change_fails_with_invalid_old_password
auth_tests.test_views.ChangelistTests.test_user_change_password`

While the second test is executing, you'll see the URLs from the first
test.

Because the default admin site is leaking into the second test, its logout
view is being called (`AdminSite.name` is 'admin' instead of
'auth_test_admin').

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:17>

Django

unread,
May 19, 2015, 5:18:44 AM5/19/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by rm_):

* has_patch: 0 => 1


Comment:

Got it! PR here https://github.com/django/django/pull/4675

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:18>

Django

unread,
May 19, 2015, 7:44:49 AM5/19/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------

Reporter: rm_ | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"ae1efb853c159ae4747d105405694245f8508b4b" ae1efb8]:
{{{
#!CommitTicketReference repository=""
revision="ae1efb853c159ae4747d105405694245f8508b4b"
Refs #24553 -- Fixed urlpatterns leakage in auth_tests
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:19>

Django

unread,
May 19, 2015, 7:49:42 AM5/19/15
to django-...@googlegroups.com
#24553: Pass application list to more admin views
-------------------------------+------------------------------------
Reporter: rm_ | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: admin | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/24553#comment:20>

Reply all
Reply to author
Forward
0 new messages