基于quintagroup.captcha.core包的z3cform的验证码字段
quintagroup.z3cform.captcha的Python项目详细描述
简介
quintagroup.z3c form.captcha是一个允许将captcha添加到z3c.form的包。 因此,这些表格无法自动提交。
Z3C格式的字幕
在z3c表单中使用quintagroup.z3c form.captcha很简单。 只需在模式中添加一个captcha字段,使用captchawidgetfactory 这个领域的小工具工厂和离开你去:
>>> from zope.interface import Interface >>> from z3c.form import form, field >>> from quintagroup.z3cform.captcha import Captcha >>> from quintagroup.z3cform.captcha import CaptchaWidgetFactory
现在用captch字段定义表单模式
>>> class ICaptchaSchema(Interface): ... captcha = Captcha( ... title=_(u'Type the code'), ... description=_(u'Type the code from the picture shown below.'))
并为验证码字段设置适当的小部件工厂
>>> class CaptchaForm(form.Form): ... fields = field.Fields(ICaptchaSchema) ... fields['captcha'].widgetFactory = CaptchaWidgetFactory
剩下的由Z3C.Form负责。与此字段关联的小部件 将呈现验证码并自动验证使用输入。
支持的plone版本
用plone 3.0.6、3.1.7、3.2.3、3.3.4对quintagroup.z3form.captcha进行检测。
更改日志
1.0.3(2013-07-17)
- 已禁用处理联机验证请求
1.0.2(2013-01-16)
- 购买力平价修正
- 修复了Python2.4的异常
- 删除了未使用的导入
- 更新的分类器
- 修复了viewpagetemplatefile导入
1.0.1(2011-10-28)
- 修复了kss内联验证
1.0(2010-04-29)
- 初始版本