Re: ModelChoiceField setting value manually

2008-06-26 Thread Adi
This may sound like a cop out, but why can't you create a gallery object with that default value. Then when you construct your query set, you can create so that that default option is returned. This would enable you to both display the correct option, as well as work during the validatio step. -R

ModelChoiceField setting value manually

2008-06-26 Thread mwebs
Hello, I try to set data for a ModelChoiceField() manually. This means the data is not in my db, so it s not in a Queryset. my form: class PictureForm(forms.Form): image = forms.ImageField(label='Picture') gallery= MyModelChoiceField(models.Gallery.objects.none(), empty