Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit c430eb8273d2f5887ec87f1adf29f0543a010fc5 1 parent 6be701e
Malcolm Tredinnick malcolmt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/forms/__init__.py
4 django/forms/__init__.py
View
@@ -434,11 +434,11 @@ def render(self, data):
(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):
Please sign in to comment.
Something went wrong with that request. Please try again.