Ticket #1767: boolean_validator_list2.patch
File boolean_validator_list2.patch, 1.6 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
247 247 params['is_required'] = not self.blank and not self.primary_key and not rel 248 248 249 249 # BooleanFields (CheckboxFields) are a special case. They don't take 250 # is_required or validator_list.250 # is_required. 251 251 if isinstance(self, BooleanField): 252 del params[' validator_list'], params['is_required']252 del params['is_required'] 253 253 254 254 # If this field is in a related context, check whether any other fields 255 255 # in the related object have core=True. If so, add a validator -- -
django/forms/__init__.py
434 434 (self.get_id(), self.field_name, escape(data)) 435 435 436 436 class CheckboxField(FormField): 437 def __init__(self, field_name, checked_by_default=False): 437 def __init__(self, field_name, checked_by_default=False, validator_list=None): 438 if validator_list is None: validator_list = [] 438 439 self.field_name = field_name 439 440 self.checked_by_default = checked_by_default 440 self.is_required, self.validator_list = False, [] # because the validator looks for these 441 self.is_required = False # because the validator looks for these 442 self.validator_list = validator_list[:] 441 443 442 444 def render(self, data): 443 445 checked_html = ''