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 <o...@gezgin.com> wrote: > 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. But in admin I > would like it to be displayed using Textarea widget. For this, there > is formfield_overrides hook but it does not work for this case. > > The admin declaration is: > > class ProductAdmin(admin.ModelAdmin): > ... > formfield_overrides = { > TagField: {'widget': admin.widgets.AdminTextareaWidget}, > } > > This has no effect on the form field widget and tags are still > rendered with a TextInput widget. > > Any help is much appreciated. > > -- > omat > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.