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 | |
---|
1 | from zope import interface, schema |
---|
2 | from zope.formlib import form |
---|
3 | from zope.publisher.browser import TestRequest |
---|
4 | from zope.interface import Interface |
---|
5 | from quintagroup.formlib.captcha import Captcha |
---|
6 | from zope.schema import TextLine |
---|
7 | |
---|
8 | # Define CaptchaFormlibForm form schema |
---|
9 | |
---|
10 | class 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 | |
---|
17 | class 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 | |
---|
25 | class CaptchaFormlibForm(form.EditForm): |
---|
26 | form_fields = form.FormFields(IFoo) |
---|
Note: See
TracBrowser
for help on using the repository browser.