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