On Feb 10, 11:42 pm, "gordyt" <[EMAIL PROTECTED]> wrote:
> > I don't think there's any way of accessing the request.user from the
> > Form class (is there?). If I could pass in the choices when I'm
> > instantiating the form from views.py my problem would be solved. Is
> > this possible?
>
> Cathy
> I don't think there's any way of accessing the request.user from the
> Form class (is there?). If I could pass in the choices when I'm
> instantiating the form from views.py my problem would be solved. Is
> this possible?
Cathy this is absolutely possible. Here is an example from one of my
pro
On Feb 10, 5:33 pm, "canen" <[EMAIL PROTECTED]> wrote:
> If I understand what you are asking, choices can be set to a function,
> as long as it returns the correct format. If you return a generator I
> think there is a bug that will only call it the first time the form
> is rendered (e.g. if ther
On Feb 10, 8:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> how?
In my project i have that code:
#in some view
form_class = AddPostForm #form adds post to the blog
form_class.base_fields[ 'category' ].choices =
getCategoriesTuple( request.blog ) #sets choices to ChoiceField
--~--~-
If I understand what you are asking, choices can be set to a function,
as long as it returns the correct format. If you return a generator I
think there is a bug that will only call it the first time the form
is rendered (e.g. if there is an error in the form the choices won't
show up when it ren
how?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more
6 matches
Mail list logo