On Sat, Apr 4, 2009 at 8:37 PM, Paddy Joy <paddy...@gmail.com> 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_<field> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to