Skip to content

Commit

Permalink
Add ModelForm
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Apr 21, 2012
1 parent 3315dda commit 04a2c03
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions recaptcha_form/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,12 @@ def __init__(self, *args, **kwargs):
label=_('Are you human?') )
super(RecaptchaForm, self).__init__(*args, **kwargs)

class RecaptchaModelForm(RecaptchaBaseForm, forms.ModelForm):
'''
Inheriting from this form gives you a reCAPTCHA field at the bottom.
'''
def __init__(self, *args, **kwargs):
self.base_fields['captcha'] = RecaptchaFieldPlaceholder(
label=_('Are you human?') )
super(RecaptchaForm, self).__init__(*args, **kwargs)

0 comments on commit 04a2c03

Please sign in to comment.