Ticket #1568: charfield_size.diff
File charfield_size.diff, 961 bytes (added by , 18 years ago) |
---|
-
django/oldforms/__init__.py
395 395 if data is None: 396 396 data = '' 397 397 maxlength = '' 398 field_size = self.length 398 399 if self.maxlength: 399 400 maxlength = 'maxlength="%s" ' % self.maxlength 401 field_size = self.maxlength 400 402 if isinstance(data, unicode): 401 403 data = data.encode(settings.DEFAULT_CHARSET) 404 402 405 return '<input type="%s" id="%s" class="v%s%s" name="%s" size="%s" value="%s" %s/>' % \ 403 406 (self.input_type, self.get_id(), self.__class__.__name__, self.is_required and ' required' or '', 404 self.field_name, self.length, escape(data), maxlength)407 self.field_name, field_size, escape(data), maxlength) 405 408 406 409 def html2python(data): 407 410 return data