From c430eb8273d2f5887ec87f1adf29f0543a010fc5 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 22 Sep 2006 01:49:11 +0000 Subject: [PATCH] Fixed #2640 -- Allow is_required for CheckboxField classes (defaults to False, which was the previous behaviour). Thanks, torbjornthorsen@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3780 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 241795312e..a4b823fefb 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -434,11 +434,11 @@ class HiddenField(FormField): (self.get_id(), self.field_name, escape(data)) class CheckboxField(FormField): - def __init__(self, field_name, checked_by_default=False, validator_list=None): + def __init__(self, field_name, checked_by_default=False, validator_list=None, is_required=False): if validator_list is None: validator_list = [] self.field_name = field_name self.checked_by_default = checked_by_default - self.is_required = False # because the validator looks for these + self.is_required = is_required self.validator_list = validator_list[:] def render(self, data):