Hi,

I'm a bit puzzled by the following behaviour of newforms.

I have a field in the form called 'seller'.

In the form validation I have a clean_seller method which if a certain
condition is verified will do the following:

self.errors.update(seller = ErrorList([u"message1: the indicated
seller doesn't exist in our database"]))
raise forms.ValidationError(u"message2: seller doesn't exist")

In the template I have the following:

<div class="error-msg">{{ monitor_f.seller.errors|join:", " }}</div>

I would expect the first message (that is: "message1: the indicated
seller doesn't exist in our database") to be displayed in case of
error and I thought that the forms.ValidationError was just an
exception raised to stop the validation. Instead the second message
(the one contained in forms.ValidationError is displayed).

Probably there is something I'm missing. Would anyone help me
understand?

Many thanks
Francesco
--~--~---------~--~----~------------~-------~--~----~
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