Re: newforms tip: dynamic ChoiceField

2007-01-18 Thread nesh
* Rubic wrote, On 14.01.2007 18:19: I've been using newforms for a few days now and just ran across something in ChoiceField that might be worth sharing. However, sometimes you'd like the choice list to be dynamic, to reflect the current values in the model. My approach is to create a class

Re: newforms tip: dynamic ChoiceField

2007-01-14 Thread Rubic
I just read Honza Král's post where he describes handling this in __init__: http://tinyurl.com/ync6y9 -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

newforms tip: dynamic ChoiceField

2007-01-14 Thread Rubic
I've been using newforms for a few days now and just ran across something in ChoiceField that might be worth sharing. The most common use case for a choice field is to pass a static list of choices. In the example below, it's a list of flavor choices: model.py: class Flavor(models.Model):