1 2 3 4 5 6 7 8 9 | from django import newforms as forms class myForm ( forms.Form ): foo = forms.CharField ( maxlength=20 ) bar = forms.CharField ( maxlength-20 ) # Now here's the Textarea baz = forms.CharField ( widget=forms.widgets.Textarea() ) |
1 2 3 4 5 6 7 8 9 | from django import newforms as forms class myForm ( forms.Form ): foo = forms.CharField ( maxlength=20 ) bar = forms.CharField ( maxlength-20 ) # Now here's the Textarea baz = forms.CharField ( widget=forms.widgets.Textarea() ) |
Comments
It's probably also worth mentioning that you may assign the rows and columns attributes in the widget:
widget=forms.widgets.Textarea(attrs={'rows':4, 'cols':60})
#
Thanks, I was rather confused that the naive
failed silently.
#