diff --git a/plone/formwidget/captcha/configure.zcml b/plone/formwidget/captcha/configure.zcml index ec6bf4e..f395f7a 100644 --- a/plone/formwidget/captcha/configure.zcml +++ b/plone/formwidget/captcha/configure.zcml @@ -40,7 +40,11 @@ provides="Products.GenericSetup.interfaces.EXTENSION" /> - - + - + + + \ No newline at end of file diff --git a/plone/formwidget/captcha/demo/__init__.py b/plone/formwidget/captcha/demo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/plone/formwidget/captcha/demo/configure.zcml b/plone/formwidget/captcha/demo/configure.zcml new file mode 100644 index 0000000..67bd27e --- /dev/null +++ b/plone/formwidget/captcha/demo/configure.zcml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/plone/formwidget/captcha/demo/form.py b/plone/formwidget/captcha/demo/form.py new file mode 100644 index 0000000..b516183 --- /dev/null +++ b/plone/formwidget/captcha/demo/form.py @@ -0,0 +1,27 @@ +from zope import interface +from z3c.form import form, field, button +from zope import schema +from plone.z3cform.layout import wrap_form +from plone.formwidget.captcha.widget import CaptchaFieldWidget + +class ICaptchaForm(interface.Interface): + captcha = schema.TextLine(title=u"Captcha", + description=u"", + required=False) + +class Captcha(object): + captcha = '' + def __init__(self, context): + self.context = context + +class BaseForm(form.Form): + """ example captcha form """ + fields = field.Fields(ICaptchaForm) + fields['captcha'].widgetFactory = CaptchaFieldWidget + + @button.buttonAndHandler(u'Save') + def handleApply(self, action): + data, errors = self.extractData() + return + +CaptchaForm = wrap_form(BaseForm) \ No newline at end of file