Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #6903 - Preserve admin `change_list` filters after saving or deleting an object #1281

Merged
merged 1 commit into from Jun 18, 2013

Conversation

Projects
None yet
3 participants
@loic
Copy link
Member

commented Jun 18, 2013

No description provided.

if "_popup" in request.POST:
return HttpResponse(
'<!DOCTYPE html><html><head><title></title></head><body>'
'<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \

This comment has been minimized.

Copy link
@aaugustin

aaugustin Jun 18, 2013

Member

You don't need the trailing \ here.

EDIT: I see you just moved that code, that's fine.

<li><a href="{% url opts|admin_urlname:'history' original.pk|admin_urlquote %}" class="historylink">{% trans "History" %}</a></li>
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>

This comment has been minimized.

Copy link
@aaugustin

aaugustin Jun 18, 2013

Member

Now this is just scary.

This comment has been minimized.

Copy link
@loic

loic Jun 18, 2013

Author Member

Totally agree, wait to see the one where we manually manipulated the querystring for the popup.

@aaugustin

View changes

docs/ref/contrib/admin/index.txt Outdated

.. versionadded:: 1.6

By default, Django's admin preserve ``ChangeList`` filters after saving or deleting

This comment has been minimized.

Copy link
@aaugustin

aaugustin Jun 18, 2013

Member

Django preserve_s_.

I'm not sure ChangeList is a public API, I'd prefer to avoid the class name.

Suggestion:

The admin now preserves filters on the list view after creating, editing
or deleting an object. You can restore the previous behavior of clearing
filters by setting this attribute to ``False``."
@aaugustin

View changes

docs/releases/1.6.txt Outdated
@@ -325,6 +325,11 @@ Minor features
:ref:`see the updated recommendation <raising-validation-error>` for raising
a ``ValidationError``.

* :class:`~django.contrib.admin.ModelAdmin` now preserve ``ChangeList`` filters

This comment has been minimized.

Copy link
@aaugustin

aaugustin Jun 18, 2013

Member

Same as above.

@aaugustin

View changes

docs/releases/1.6.txt Outdated
``_changelist_filters`` GET parameter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To achieve preserving and restoring ``ChangeList`` filters, admin views now

This comment has been minimized.

Copy link
@aaugustin

aaugustin added a commit that referenced this pull request Jun 18, 2013

Merge pull request #1281 from loic/ticket6903
Fixed #6903 - Preserved admin changelist filters.

@aaugustin aaugustin merged commit 9da9b3e into django:master Jun 18, 2013

@Bolik

This comment has been minimized.

Copy link

commented on c86a9b6 Oct 9, 2013

Is it possible to make a backport for 1.4.x or 1.5.x ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.