Re: Adding an error to an empty error list with newforms?

2007-04-05 Thread BrandonC
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

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread [EMAIL PROTECTED]
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

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread Malcolm Tredinnick
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

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread anders conbere
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

Adding an error to an empty error list with newforms?

2007-04-04 Thread [EMAIL PROTECTED]
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