Smacc Kleina wrote:
Hi folks,
we have some input forms in our project where 'meta' generated forms are enough. But we have to change widget to tinymce enabled 'richedit' fields in CharFields.
Is it possible to change only one widget and keep auto-generated form?
Which version of django are you using? In trunk, using newforms/modelforms for generating the form from a model, it is done like this:

If you want to override a field’s default widget, then specify the widget parameter when declaring the form field:

class ArticleForm(ModelForm):
...     pub_date = DateField(widget=MyDateWidget())
...
...     class Meta:
...         model = Article


Taken from: http://www.djangoproject.com/documentation/modelforms/

Good luck!


Jeff Anderson

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to