I'm working on porting an app over to newforms as a learning exercise, and running into what I'm sure will be a pretty common pattern: wanting to populate the choices for a ChoiceField from a QuerySet. This is easy enough to do, except that the QuerySet only gets evaluated once per server process (when the file containing the form gets imported), so any change to the data it's building from won't be reflected.
It feels slightly hackish to try to do this in, say, the form's __init__; any chance of getting ChoiceField to check whether the 'choices' argument is a callable and do the right thing? Then it'd just be a matter of defining a function which generates the choice list. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
