Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored September 22, 2006

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/forms/__init__.py
4  django/forms/__init__.py
@@ -434,11 +434,11 @@ def render(self, data):
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, validator_list=None):
  437
+    def __init__(self, field_name, checked_by_default=False, validator_list=None, is_required=False):
438 438
         if validator_list is None: validator_list = []
439 439
         self.field_name = field_name
440 440
         self.checked_by_default = checked_by_default
441  
-        self.is_required = False # because the validator looks for these
  441
+        self.is_required = is_required
442 442
         self.validator_list = validator_list[:]
443 443
 
444 444
     def render(self, data):

0 notes on commit c430eb8

Please sign in to comment.
Something went wrong with that request. Please try again.