source: products/quintagroup.z3cform.captcha/trunk/README.txt

Last change on this file was 2232, checked in by olha, 14 years ago

README file updated with usage exmaple.

File size: 1.4 KB
Line 
1Introduction
2============
3
4quintagroup.z3cform.captcha is a package that allows to add captcha to the z3c.form.
5As a result such forms are prevented from automatic submit.
6
7Captchas in a z3c form
8----------------------
9
10Using quintagroup.z3cform.captcha in a z3c.form form is simple.
11Just add a Captcha field to your schema, use CaptchaWidgetFactory
12widget 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
19Now 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
26And 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
33and z3c.form will take care of the rest. The widget associated with this field
34will render the captcha and verify the use input automatically.
35
36Supported Plone versions
37------------------------
38
39quintagroup.z3cform.captcha was tested with Plone 3.0.6, 3.1.7, 3.2.3, 3.3.4.
40
41Authors
42-------
43
44* Taras Melnychuk
45* Andriy Mylenkyi
46* Vitaliy Stepanov
47
48Copyright (c) "Quintagroup": http://quintagroup.com, 2004-2010
Note: See TracBrowser for help on using the repository browser.