Ticket #1006: formfields.diff
File formfields.diff, 968 bytes (added by , 19 years ago) |
---|
-
django/trunk/django/core/formfields.py
325 325 326 326 class TextField(FormField): 327 327 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): 329 329 self.field_name = field_name 330 330 self.length, self.maxlength = length, maxlength 331 331 self.is_required = is_required 332 332 self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list 333 if member_name != None: 334 self.member_name = member_name 333 335 334 336 def isValidLength(self, data, form): 335 337 if data and self.maxlength and len(data.decode(DEFAULT_CHARSET)) > self.maxlength: