mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #1767 -- boolean fields may now have validators! Thanks, Joseph.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -434,10 +434,12 @@ class HiddenField(FormField):
|
||||
(self.get_id(), self.field_name, escape(data))
|
||||
|
||||
class CheckboxField(FormField):
|
||||
def __init__(self, field_name, checked_by_default=False):
|
||||
def __init__(self, field_name, checked_by_default=False, validator_list=None):
|
||||
if validator_list is None: validator_list = []
|
||||
self.field_name = field_name
|
||||
self.checked_by_default = checked_by_default
|
||||
self.is_required, self.validator_list = False, [] # because the validator looks for these
|
||||
self.is_required = False # because the validator looks for these
|
||||
self.validator_list = validator_list[:]
|
||||
|
||||
def render(self, data):
|
||||
checked_html = ''
|
||||
|
||||
Reference in New Issue
Block a user