For example: If i clicked an item in app shop in the middle of the items
list, or in search results, I have to find it manually or by using the
search-on-page in the browser after saving the object. This problem can
easily be solved by adding a link in the message to the object, which
appears on top of the page after creating/updating. The title is already
in there, so it should not be that hard to resolve the url to the admin
page.
Example message: The item "Vintage Star Trek action figure" was changed
successfully.
New message: The item "__Vintage Star Trek action figure__" was changed
successfully.
Of course there are some cases, like when the change page ({{ app_label
}}_{{ model_name }}_change) is not used or overriden or whatever the coder
did to break the url structure and not using the correct names anymore.
--
Ticket URL: <https://code.djangoproject.com/ticket/19361>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: BozeWolf (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I forgot to login when posting this ticket. But i'm the owner. I added
myself to Cc.
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:1>
* owner: nobody => bak1an
* status: new => assigned
* stage: Unreviewed => Accepted
Comment:
this will be usable
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:2>
* version: 1.5-alpha-1 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:3>
Comment (by bak1an):
some status update:
* a branch with quick implementation (not finished yet)
[https://github.com/bak1an/django/compare/admin-messages admin-messages]
* this is kind of depends on #19387. when (if) it will be merged into
master we will be able to remove next hunk from diff (i don't like this
{{{safe}}} filter there):
{{{
--- a/django/contrib/admin/templates/admin/base.html
+++ b/django/contrib/admin/templates/admin/base.html
@@ -53,7 +53,7 @@
{% block messages %}
{% if messages %}
<ul class="messagelist">{% for message in messages %}
- <li{% if message.tags %} class="{{ message.tags }}"{% endif
%}>{{ message }}</li>
+ <li{% if message.tags %} class="{{ message.tags }}"{% endif
%}>{{ message|safe }}</li>
{% endfor %}</ul>
{% endif %}
{% endblock messages %}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:4>
Comment (by BozeWolf):
Good to see progress. Will test it as soon as it's finished.
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:5>
Comment (by bak1an):
[https://github.com/django/django/pull/786 pull request]
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:6>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:7>
* needs_better_patch: 0 => 1
Comment:
needs rebase
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:8>
* has_patch: 1 => 0
Comment:
patch is too old, will try to update it
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:9>
* needs_better_patch: 1 => 0
* has_patch: 0 => 1
Comment:
it's been a long time, but here goes rebased pull request
https://github.com/django/django/pull/5244
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:10>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:11>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:12>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:13>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:14>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:15>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:16>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"80bcbecd4a394f67c1679b077ba79a797c4a57d7" 80bcbecd]:
{{{
#!CommitTicketReference repository=""
revision="80bcbecd4a394f67c1679b077ba79a797c4a57d7"
Fixed #19361 -- Added link to object's change form in admin's post-save
message.
Thanks Roel Kramer for tests.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19361#comment:17>