Opened 12 years ago
Closed 9 years ago
#19361 closed New feature (fixed)
Link to object in message after creating/updating object in django admin
Reported by: | anonymous | Owned by: | Anton Baklanov |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | admin, messages, update_object, create_object |
Cc: | BozeWolf | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When you have a lot of objects listed in the admin, like items in a shop, it is hard to find the object after you created/updated it. Obviously there is an option "Save and continue editing" but in practice it happens that after saving users suddenly realize there are not finished yet.
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.
Change History (17)
comment:2 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
this will be usable
comment:3 by , 12 years ago
Version: | 1.5-alpha-1 → master |
---|
comment:4 by , 12 years ago
some status update:
- a branch with quick implementation (not finished yet) 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 %}
comment:7 by , 12 years ago
Has patch: | set |
---|
comment:10 by , 9 years ago
Has patch: | set |
---|---|
Patch needs improvement: | unset |
it's been a long time, but here goes rebased pull request https://github.com/django/django/pull/5244
comment:11 by , 9 years ago
Patch needs improvement: | set |
---|
I left comments for improvement on the pull request.
comment:12 by , 9 years ago
Patch needs improvement: | unset |
---|
comment:13 by , 9 years ago
Patch needs improvement: | set |
---|
comment:14 by , 9 years ago
Patch needs improvement: | unset |
---|
comment:15 by , 9 years ago
Patch needs improvement: | set |
---|
comment:16 by , 9 years ago
Patch needs improvement: | unset |
---|
I forgot to login when posting this ticket. But i'm the reporter. I added myself to Cc.