-
Notifications
You must be signed in to change notification settings - Fork 83
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
Return to preserved filters on change_list after object action #88
Conversation
If you want to filter change_list by some conditions, then open each object and run some object action there, you will be returned to change_list with the same preserved filters. Fix #83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoa, TIL add_preserved_filters
!https://github.com/django/django/blob/master/django/contrib/admin/templatetags/admin_urls.py
@@ -1,17 +1,19 @@ | |||
{% extends "admin/change_form.html" %} | |||
|
|||
{% load admin_urls %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to be {% load add_preserved_filters from admin_urls %}
. This reduces the "magic" that happens when you load templatetags of not knowing which template tag came from where.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
{% block object-tools-items %} | ||
{% for tool in objectactions %} | ||
{% for tool in objectactions %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this whitespace style from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's natural for me to use 4-space indentation. It seems that you use 2-space indentation in templates, so I'll fix it.
But at the same time you've originally indented {% for k, v in tool.custom_attrs.items %}
block and class="{{ tool.standard_attrs.class }}"
with 9 and 11 spaces. Should I use 8 and 10 spaces there?
P.S. I've reverted indentation to original style. If something's wrong - please reply in comment.
not sure why TravisCI isn't running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, and TravisCI ran this time too
If you want to filter change_list by some conditions, then open each object and run some object action there, you will be returned to change_list with the same preserved filters.
Fix #83