Hanne Moa wrote:
> On Fri, Sep 19, 2008 at 7:34 PM, Karthik Krishnan
> <[EMAIL PROTECTED]> wrote:
>   
>> It throws a debug error page.
>>     
>
> What Kenneth was trying to say was *which* error was in the debug error page.
>
>   
>> On Sep 18, 10:01 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>>     
>>> On Friday 19 Sep 2008 7:02:06 am Karthik Krishnan wrote:
>>>
>>>       
>>>> The premise is this: If the form validation fails, I want to display
>>>> all the validation error messages on the top of the page in a special
>>>> div tag that I have created.
>>>>         
>>>> {% for field, message in form.errors.items()%}
>>>>   {{message}}
>>>>         
>>>> {% endfor %}
>>>>         
>
> Unless you're using jinja you're misunderstanding what's possible in a
> template. You can't have the () at the end of form.errors.items for
> one and I'm not sure about automatic tuple-unpacking either (the
> "field, message"-bit.) Django-templates ain't python.
>   
Maybe I have to be even more explicit than the message I posted four
days ago.

Instead of writing

{% for field, message in form.errors.items()%}
  {{message}}
{% endfor %}

Write

{% for field, message in form.errors.items %}
  {{message}}
{% endfor %}

As Hanne points out, you cannot use function calls inside Django template 
expressions: if the value is callable (as form.errors.items is) then it will be 
called automatically. And don't forget the space after the opening {% *and* 
before the closing %}.

regards
 Steve




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to