Ticket #1568: charfield_size.diff

File charfield_size.diff, 961 bytes (added by LawrenceOluyede, 18 years ago)
  • django/oldforms/__init__.py

     
    395395        if data is None:
    396396            data = ''
    397397        maxlength = ''
     398        field_size = self.length
    398399        if self.maxlength:
    399400            maxlength = 'maxlength="%s" ' % self.maxlength
     401            field_size = self.maxlength
    400402        if isinstance(data, unicode):
    401403            data = data.encode(settings.DEFAULT_CHARSET)
     404           
    402405        return '<input type="%s" id="%s" class="v%s%s" name="%s" size="%s" value="%s" %s/>' % \
    403406            (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)
    405408
    406409    def html2python(data):
    407410        return data
Back to Top