Re: Custom validation in view?

2009-04-04 Thread Paddy Joy

Thanks Alex that's exactly what I was looking for!

Paddy

On Apr 5, 10:40 am, Alex Gaynor  wrote:
> On Sat, Apr 4, 2009 at 8:37 PM, Paddy Joy  wrote:
>
> > I need to validate some data from a form however I need access to the
> > request object as the data validation will be different depending on
> > the logged on user.
>
> > What is the preferred method for this type of validation? Can i
> > validate thee data in the view and manually set the form field errors?
>
> > Paddy
>
> Take a look at number 2 
> here:http://collingrady.wordpress.com/2008/07/24/useful-form-tricks-in-dja...
> basically you'll just store user on your form object and then you can use it
> in your clean_ methods.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Custom validation in view?

2009-04-04 Thread Alex Gaynor
On Sat, Apr 4, 2009 at 8:37 PM, Paddy Joy  wrote:

>
> I need to validate some data from a form however I need access to the
> request object as the data validation will be different depending on
> the logged on user.
>
> What is the preferred method for this type of validation? Can i
> validate thee data in the view and manually set the form field errors?
>
> Paddy
>
> >
>
Take a look at number 2 here:
http://collingrady.wordpress.com/2008/07/24/useful-form-tricks-in-django/
basically you'll just store user on your form object and then you can use it
in your clean_ methods.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---