On Mon, Mar 12, 2012 at 12:34 PM, Matt Schinckel <m...@schinckel.net> wrote:
> You are mixing up views and forms. The OP was asking about forms, not views.
>
> Personally, I'm starting to hit more and more cases where I would like the
> form to be able to access the request (and associated data). For instance,
> being able to limit the queryset of choices for a related field, depending
> upon the logged in user.
>
> (I have an API framework that uses forms for de/serialisation, called
> django-repose, but it's not fully ready for human consumption. I'm still
> thinking about the best way to handle this particular issue, for instance).
>
> Matt.
>

If your form requires access to the request object, or to the
currently logged in user, it should simply take that object as an
additional required argument to the form constructor. There should be
no need for any magic here.

Cheers

Tom

-- 
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