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
|
Rev | Line | |
---|
[2802] | 1 | from zope.schema import TextLine |
---|
| 2 | from zope.interface import Interface, implements |
---|
[2804] | 3 | from zope.formlib.form import FormFields |
---|
| 4 | from plone.app.form.base import EditForm |
---|
[2802] | 5 | |
---|
[2801] | 6 | from quintagroup.formlib.captcha import Captcha |
---|
[2810] | 7 | |
---|
[3121] | 8 | |
---|
[2801] | 9 | # Define CaptchaFormlibForm form schema |
---|
| 10 | class ICaptchaFormlibFormSchema(Interface): |
---|
[2807] | 11 | label = TextLine(title=u'Label', |
---|
| 12 | required=False) |
---|
[2801] | 13 | captcha = Captcha(title=u'Type the code') |
---|
[3121] | 14 | |
---|
| 15 | |
---|
[2801] | 16 | # Create adapter for any object to ICaptchaFormlibFormSchema |
---|
| 17 | # schema interface |
---|
| 18 | class CaptchaFormlibFormAdapter(object): |
---|
[2802] | 19 | implements(ICaptchaFormlibFormSchema) |
---|
[2803] | 20 | |
---|
| 21 | def __init__(self, context): |
---|
| 22 | self.context = context |
---|
| 23 | |
---|
[2801] | 24 | label = u'' |
---|
| 25 | captcha = None |
---|
[3121] | 26 | |
---|
| 27 | |
---|
[2801] | 28 | # And at the last define the CaptchaFormlibForm form |
---|
[2802] | 29 | class CaptchaFormlibForm(EditForm): |
---|
| 30 | form_fields = FormFields(ICaptchaFormlibFormSchema) |
---|
Note: See
TracBrowser
for help on using the repository browser.