Last change
on this file since 3605 was
3124,
checked in by vmaksymiv, 13 years ago
|
pylint fixes
|
-
Property svn:eol-style set to
native
|
File size:
832 bytes
|
Line | |
---|
1 | from zope.schema import TextLine |
---|
2 | from zope.interface import Interface, implements |
---|
3 | from zope.formlib.form import FormFields |
---|
4 | from plone.app.form.base import EditForm |
---|
5 | |
---|
6 | from quintagroup.formlib.captcha import Captcha |
---|
7 | |
---|
8 | |
---|
9 | # Define CaptchaFormlibForm form schema |
---|
10 | class ICaptchaFormlibFormSchema(Interface): |
---|
11 | label = TextLine(title=u'Label', |
---|
12 | required=False) |
---|
13 | captcha = Captcha(title=u'Type the code') |
---|
14 | |
---|
15 | |
---|
16 | # Create adapter for any object to ICaptchaFormlibFormSchema |
---|
17 | # schema interface |
---|
18 | class CaptchaFormlibFormAdapter(object): |
---|
19 | implements(ICaptchaFormlibFormSchema) |
---|
20 | |
---|
21 | def __init__(self, context): |
---|
22 | self.context = context |
---|
23 | |
---|
24 | label = u'' |
---|
25 | captcha = None |
---|
26 | |
---|
27 | |
---|
28 | # And at the last define the CaptchaFormlibForm form |
---|
29 | class CaptchaFormlibForm(EditForm): |
---|
30 | form_fields = FormFields(ICaptchaFormlibFormSchema) |
---|
Note: See
TracBrowser
for help on using the repository browser.