views:

237

answers:

1

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.
+3  A: 

I think Textarea needs to be assigned as a widget.

Try

class HouseForm(forms.ModelForm):
    address = forms.CharField(widget=forms.Textarea)

    class Meta:
        model = House
bebraw