Re: Overriding the widget of a custom form field in admin

2010-08-13 Thread Bill Freeman
I suspect that you must refrain from setting self.widget if widget is in kwargs. On Thu, Aug 12, 2010 at 1:22 PM, omat wrote: > Hi All, > > I have a custom TagField form field. > > class TagField(forms.CharField): >    def __init__(self, *args, **kwargs): >        super(TagField, self).__init__(*

Overriding the widget of a custom form field in admin

2010-08-12 Thread omat
Hi All, I have a custom TagField form field. class TagField(forms.CharField): def __init__(self, *args, **kwargs): super(TagField, self).__init__(*args, **kwargs) self.widget = forms.TextInput(attrs={'class':'tag_field'}) As seen above, it uses a TextInput form field widget.