Ticket #4825: widgets.diff
File widgets.diff, 755 bytes (added by , 17 years ago) |
---|
-
django/newforms/widgets.py
77 77 def render(self, name, value, attrs=None): 78 78 if value is None: value = '' 79 79 final_attrs = self.build_attrs(attrs, type=self.input_type, name=name) 80 if value != '': final_attrs['value'] = force_unicode(value) # Only add the 'value' attribute if a value is non-empty. 80 if value != '' and self.input_type!="file": 81 final_attrs['value'] = force_unicode(value) # Only add the 'value' attribute if a value is non-empty. 81 82 return u'<input%s />' % flatatt(final_attrs) 82 83 83 84 class TextInput(Input):