summaryrefslogtreecommitdiff
path: root/django/newforms
diff options
context:
space:
mode:
Diffstat (limited to 'django/newforms')
-rw-r--r--django/newforms/widgets.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py
index 8d292673a5..f701faa35d 100644
--- a/django/newforms/widgets.py
+++ b/django/newforms/widgets.py
@@ -121,6 +121,12 @@ class FileInput(Input):
input_type = 'file'
class Textarea(Widget):
+ def __init__(self, attrs=None):
+ # The 'rows' and 'cols' attributes are required for HTML correctness.
+ self.attrs = {'cols': '40', 'rows': '10'}
+ if attrs:
+ self.attrs.update(attrs)
+
def render(self, name, value, attrs=None):
if value is None: value = ''
value = smart_unicode(value)