Forms aren't only usable from inside a view.
On Sunday, March 11, 2012 at 4:32 AM, shacker wrote: > I recently needed to access request.user in a form, and found that I > couldn't. Found many articles describing ways to accomplish this, such as > James Bennett's [1]. > > I did get it working, but I'm curious *why* the request object isn't > accessible from forms as it is from views. Why do we need to override > __init__ to accomplish this? Seems like the kind of thing Django could "take > care of" for us. > > [1] http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ > > Thanks to anyone who can clarify. > > ./s > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/1z9ElVqpRucJ. > To post to this group, send email to django-users@googlegroups.com > (mailto:django-users@googlegroups.com). > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > (mailto:django-users+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- 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.