anyone on this ? How to display error messages ?
On Thu, May 27, 2010 at 3:49 AM, Nicolas Steinmetz <[email protected]>wrote: > Nobody on this issue ? > > On 21 mai, 15:46, Nicolas Steinmetz <[email protected]> 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 [email protected]. > > To unsubscribe from this group, send email to > [email protected]<django-users%[email protected]> > . > > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<django-users%[email protected]> > . > For more options, visit this group at > http://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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

