>From what I understand of Python, your choices code is only getting
called once when Python loads your form class for the first time.  To
get around this you can assign choices from within the __init__() of
the form (which is called when the form is instantiated)  This snippet
explains better than I can:

http://www.djangosnippets.org/snippets/26/



On Apr 13, 8:39 am, "Ryan Alexander" <[EMAIL PROTECTED]> wrote:
> I've got this little bit of code in my Views.py file:
>
> def get_suite_choices():
>     for suite in Suite.objects.all().order_by('title'):
>         yield (suite.id, suite.title)
>
> class StartSuiteForm(Form):
>     suite = ChoiceField(choices=get_suite_choices())
>     username = CharField('username',widget=TextInput())
>     password = CharField(widget=PasswordInput())
>     reportusername = CharField('logusername',widget=TextInput())
>     reportpassword = CharField(widget=PasswordInput())
>
> yet when I make changes to a Suite (like re-name the title) it doesn't
> show up n the choice field on the form.
>
> I'm doing an apache2/mod_python install.  If I restart the server, the
> changes then show up.
>
> ??


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to