Re: is it possible to pass a dynamic list of choices to a select widget?
cheers for reading Steve.
I've been through the documentation again and it definitely states
that the widget wants an iterable. so i dont think im going to be able
to do what i wanted to do, need another approach.
Matt
On 3 Aug, 16:15, Steve Holden <holden...@gmail.com> wrote:
> On 8/3/2010 11:12 AM, shofty wrote:
>
> > Steve,
>
> > the choices are different for each product in the shop.
> > some choices are clothing sizes, some physical sizes etc.
>
> > So with that in mind i could go with a bunch of choices hooked up to a
> > choices field if i can tell the form which choice field to use based
> > around the product attribute stored.
>
> > but what if im not the shop admin?
> > in that case i'd have to amend the code every time something goes out
> > of stock in a certain size.
>
> > so i came upon the plan to have a boolean denote whether or not the
> > object has a size option and if so store the options in the model so
> > that it could be amended in the admin pages. then draw a select at
> > runtime with the right options in it.
>
> > thanks for the other pointers, i had an idea the function wasn't right
> > and indeed it isn't going to work at all since the widget won't allow
> > a callable.
>
> > i'll try turning that function into a method on the form and see if it
> > won't work that way
>
> Good stuff. This is a pretty helpful group, so do post again when you
> have further issues. Nobody gets it right the first time ...
>
> regards
> Steve
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home