1
0
mirror of https://github.com/django/django.git synced 2025-10-29 08:36:09 +00:00

Fixed #3929 -- Newforms Textarea widget now always includes 'rows' and 'cols' attributes, even if you don't pass them in, for HTML correctness. Thanks, and welcome back, Luke Plant

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-04-09 01:22:45 +00:00
parent 7693000788
commit e34e433641
3 changed files with 24 additions and 18 deletions

View File

@@ -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)