source: products/quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/example.py @ 2801

Last change on this file since 2801 was 2801, checked in by mylan, 14 years ago

#195: Prepared doctests infrastructure

  • Property svn:eol-style set to native
File size: 795 bytes
Line 
1from zope import interface, schema
2from zope.formlib import form
3from zope.publisher.browser import TestRequest
4from zope.interface import Interface
5from quintagroup.formlib.captcha import Captcha
6from zope.schema import TextLine
7     
8# Define CaptchaFormlibForm form schema
9
10class ICaptchaFormlibFormSchema(Interface):
11    label = TextLine(title=u'Label')
12    captcha = Captcha(title=u'Type the code')
13     
14# Create adapter for any object to ICaptchaFormlibFormSchema
15# schema interface
16
17class CaptchaFormlibFormAdapter(object):
18    adapts(interface.Interface)
19    interface.implements(ICaptchaFormlibFormSchema)
20    label = u''
21    captcha = None
22     
23# And at the last define the CaptchaFormlibForm form
24
25class CaptchaFormlibForm(form.EditForm):
26    form_fields = form.FormFields(IFoo)
Note: See TracBrowser for help on using the repository browser.