On Mon, Nov 3, 2008 at 2:16 PM, nazar <[EMAIL PROTECTED]> wrote: > > I met some unusual behavior in my project in admin change form with > inlines. There is code in template change_form.html: > > {% blocktrans count errors.items|length as counter %}Please correct > the error below.{% plural %}Please correct the errors below.{% > endblocktrans %} > > Template can't evaluate 'errors.items' object. > > As I saw in code there is no "items" attribute, method or dictionary > key in 'errors'. > > Can anybody explain what is this and why it works? > > Looks like a bug. The '.items' part just shouldn't be there. As it is no matter whether there is a single or multiple errors the plural message is displayed. Removing the .items (errors is a list type, not a dictionary) fixes things so that the singular message is displayed when there is only one error to be fixed.
Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---