On Fri, Jun 27, 2008 at 11:04 AM, Roodie <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have a slight problem. I am using a custom form field to do some
> extra validation / filtering on a specific kind of field. The code is
> very simple:
>
> class HtmlEditorField(forms.Textarea):
>        def clean(self, value):
>                value = filter_common( value )
>                return super(HtmlEditorField, self).clean(value)

This won't work. The forms.Textarea you're subclassing is a *widget*,
not a *field*!

> And I use this field to render the textareas:
>
> class RandomEditForm( ModelForm ):
>        description = HtmlField()
>
> Now the question is: where can I set the ROWS attribute for this
> Textarea?

See http://www.djangoproject.com/documentation/newforms/#specifying-widgets


Arien

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to