Re: Problem when filling the options of a Choice Field with information from the database

2007-07-10 Thread Nathan Ostgard
This looks like a foreign key relationship (probably should be if it's not). Use ModelChoiceField instead of ChoiceField. I haven't used it manually in a form before, but try this: instrument = ModelChoiceField(queryset=Instrument.objects.all(), cache_choices=False, required=False) Note that

Problem when filling the options of a Choice Field with information from the database

2007-07-10 Thread AnaReis
Hi, I have a form on my project which has a drop down list with several options that are loaded from a table in a database. The code is this: class ProductForm(forms.Form): instrument_Name=ChoiceField(required=False, choices=[(i.instrument_name,i.instrument_name) for i in