Fixed #11703: Added missing Super calls to 2 widget classes.

Thanks Rupe



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2009-09-10 16:30:41 +00:00
parent 49b9470dca
commit d18dace8eb
1 changed files with 4 additions and 2 deletions

View File

@ -139,6 +139,7 @@ class Widget(object):
self.attrs = attrs.copy() self.attrs = attrs.copy()
else: else:
self.attrs = {} self.attrs = {}
super(Widget, self).__init__(attrs)
def __deepcopy__(self, memo): def __deepcopy__(self, memo):
obj = copy.copy(self) obj = copy.copy(self)
@ -275,9 +276,10 @@ class FileInput(Input):
class Textarea(Widget): class Textarea(Widget):
def __init__(self, attrs=None): def __init__(self, attrs=None):
# The 'rows' and 'cols' attributes are required for HTML correctness. # The 'rows' and 'cols' attributes are required for HTML correctness.
self.attrs = {'cols': '40', 'rows': '10'} default_attrs = {'cols': '40', 'rows': '10'}
if attrs: if attrs:
self.attrs.update(attrs) default_attrs.update(attrs)
super(Textarea, self).__init__(default_attrs)
def render(self, name, value, attrs=None): def render(self, name, value, attrs=None):
if value is None: value = '' if value is None: value = ''