Oliver,
form['fieldname'] returns a Field class object. To add an error to
that you want to do form.errors['fieldname'] = ['Your list of errors
messages'].
If you also want to preserve other possible errors you'll want to us
form.errors.setdefault('fieldname', []).append('Your error here.')
ins
Thanks for your comments. I've had a dig around in the code for
newforms -- and it appears that to make an error, it raises
django.newforms.util.ValidationError -- the only thing I don't get is
how it binds this to a form field -- any ideas as all it seems to take
is one argument -- the error mess
On Wed, 2007-04-04 at 14:41 -0700, [EMAIL PROTECTED] wrote:
> Hey All,
>
> I'm trying to use newforms to create a form to login on my site
> (there's some stuff in the userprofile which prevents me from using
> ths standard django.contrib.auth.views.login view)
>
> I nearly have everything set u
If you're using custom forms it's often times much easier to do
validation within the forms class using the clean_xxx() methods. I
know this isn't the question you're asking, but I feel like that
should be thrown out there.
~ Anders
On 4/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hey
Hey All,
I'm trying to use newforms to create a form to login on my site
(there's some stuff in the userprofile which prevents me from using
ths standard django.contrib.auth.views.login view)
I nearly have everything set up just as I'd like it.. but it seems
that when newforms validators have pe
5 matches
Mail list logo