Ticket #1006: formfields.diff

File formfields.diff, 968 bytes (added by Gustavo Picon <gpicon@…>, 19 years ago)
  • django/trunk/django/core/formfields.py

     
    325325
    326326class TextField(FormField):
    327327    input_type = "text"
    328     def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[]):
     328    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[], member_name=None):
    329329        self.field_name = field_name
    330330        self.length, self.maxlength = length, maxlength
    331331        self.is_required = is_required
    332332        self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list
     333        if member_name != None:
     334            self.member_name = member_name
    333335
    334336    def isValidLength(self, data, form):
    335337        if data and self.maxlength and len(data.decode(DEFAULT_CHARSET)) > self.maxlength:
Back to Top