Re: How to customize ModelChoiceField?

2010-05-30 Thread shaunc
I think I've solved this myself. I needed two fields for description: one for the description pk (in case it is pre-existing) and one for the text. I changed the widget for the description via RateForm.Meta.widgets to a HiddenInput widget, and added the text field to the form separately. In

How to customize ModelChoiceField?

2010-05-29 Thread shaunc
I have a table of Rates: class Rate( models.Model ): edition = ForeignKey( Edition ) description = ForeignKey( Foo ) rate = IntegerField( ) ... [ other fields not relevant here ] and a RateForm: class RateForm( forms.ModelForm ): class Meta: fields = ( 'description',