How to cutomize a modelform widget in django 1.1?

Posted by muudscope on Stack Overflow See other posts from Stack Overflow or by muudscope
Published on 2010-03-27T05:04:29Z Indexed on 2010/03/27 5:13 UTC
Read the original article Hit count: 247

Filed under:
|
|

I'm trying to modify a django form to use a textarea instead of a normal input for the "address" field in my house form. The docs seem to imply this changed from django 1.1 (which I'm using) to 1.2. But neither approach is working for me. Here's what I've tried:

class HouseForm(forms.ModelForm):
    address = forms.Textarea() # Should work with django 1.1, but doesn't

    class Meta:
        model = House
        #widgets = { 'address': forms.Textarea() } # 1.2 style - doesn't work either.

© Stack Overflow or respective owner

Related posts about python

Related posts about django