On Mar 9, 7:20 am, Odd wrote:
> It works fine if I'm not using a modelform, i.e.
>
> class MyForm(forms.Form):
> data=forms.CharField(widget=MySelect())
>
> Can one not use a custom widget in a modelform?
>
> Thanks.
The 'widgets' argument is new in the development version, it's not in
1.1. (I
i have customized multiselect widget on a model field and it works like
this:
class MyModelForm(ModelForm):
field = ModelMultipleChoiceField(MyOtherModel.objects,
required=False, widget=MultipleSelectWithPop)
class Meta:
model = MyModel
let me know!
Odd wrote:
> It works
It works fine if I'm not using a modelform, i.e.
class MyForm(forms.Form):
data=forms.CharField(widget=MySelect())
Can one not use a custom widget in a modelform?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this grou
I'm trying to write a custom select widget for a modelform field, but
the render method of the widget doesn't seem to get called.
This is how I define the modelform:
class MyForm(ModelForm):
class Meta:
model=MyModel
fields=('data',)
widgets = {
'data': MyS
4 matches
Mail list logo