Nobody on this issue ? On 21 mai, 15:46, Nicolas Steinmetz <nsteinm...@gmail.com> wrote: > Hi, > > For some actions I made from the Django built-in admin, I would like > to improve the user experience with a better distinction between > sucess & error messages. > > With Django 1.1.x, I used to use Model admin actions [1] with > statements like : > > modeladmin.message_user(request, "%s successfully marked as > published." % message_bit) > > With the new 1.2 version, I was about to use the messages framework > and the messages.success() / messages.error() shortcuts to provide a > better experience. I now have in my code : > > messages.success(request, "%s successfully marked as published." % > message_bit) > > So running my own admin/base.html file, I replaced the messages > section by the example provided in the doc [2] : > > {% if messages %} > <ul class="messages"> > {% for message in messages %} > <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message > }}</li> > > {% endfor %} > </ul> > {% endif %} > > What happens is that messages.tags is empty.If I understand well the > doc, I should have an "error" or "success" tags for my error/success > messages. > > What did I miss ? Or is it a bug ? Or the admin do not use yet the new > message framework ? > > [1]http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#actio... > [2]http://docs.djangoproject.com/en/1.2/ref/contrib/messages/#ref-contri... > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.