Changeset 2232 in products
- Timestamp:
- Apr 29, 2010 9:10:08 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.z3cform.captcha/trunk/README.txt
r2218 r2232 4 4 quintagroup.z3cform.captcha is a package that allows to add captcha to the z3c.form. 5 5 As a result such forms are prevented from automatic submit. 6 7 Captchas in a z3c form 8 ---------------------- 9 10 Using quintagroup.z3cform.captcha in a z3c.form form is simple. 11 Just add a Captcha field to your schema, use CaptchaWidgetFactory 12 widget factory for this field and away you go: 13 14 >>> from zope.interface import Interface 15 >>> from z3c.form import form, field 16 >>> from quintagroup.z3cform.captcha import Captcha 17 >>> from quintagroup.z3cform.captcha import CaptchaWidgetFactory 18 19 Now define form schema with Captch field 20 21 >>> class ICaptchaSchema(Interface): 22 ... captcha = Captcha( 23 ... title=_(u'Type the code'), 24 ... description=_(u'Type the code from the picture shown below.')) 25 26 And set proper widget factory for the captcha field 27 28 >>> class CaptchaForm(form.Form): 29 ... fields = field.Fields(ICaptchaSchema) 30 ... fields['captcha'].widgetFactory = CaptchaWidgetFactory 31 32 33 and z3c.form will take care of the rest. The widget associated with this field 34 will render the captcha and verify the use input automatically. 6 35 7 36 Supported Plone versions
Note: See TracChangeset
for help on using the changeset viewer.