Last change
on this file since 1 was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
File size:
990 bytes
|
Line | |
---|
1 | from Products.CMFCore.permissions import View |
---|
2 | |
---|
3 | from Products.Archetypes.atapi import * |
---|
4 | from Products.ATContentTypes.content.base import registerATCT |
---|
5 | |
---|
6 | from Products.PloneFormGen.content.fieldsBase import BaseFormField, BaseFieldSchemaStringDefault |
---|
7 | from Products.PloneFormGen.content.fields import FGStringField |
---|
8 | |
---|
9 | from Products.qPloneCaptchaField.config import PROJECTNAME |
---|
10 | from Products.qPloneCaptchaField.widgets.CaptchaWidget import CaptchaWidget |
---|
11 | |
---|
12 | class CaptchaField(FGStringField): |
---|
13 | |
---|
14 | schema = BaseFieldSchemaStringDefault |
---|
15 | |
---|
16 | def __init__(self, oid, **kwargs): |
---|
17 | """ initialize class """ |
---|
18 | |
---|
19 | BaseFormField.__init__(self, oid, **kwargs) |
---|
20 | |
---|
21 | # set a preconfigured field as an instance attribute |
---|
22 | self.fgField = StringField('fg_string_field', |
---|
23 | searchable=0, |
---|
24 | required=1, |
---|
25 | write_permission = View, |
---|
26 | validators=('isCaptchaCorrect',), |
---|
27 | widget=CaptchaWidget(), |
---|
28 | ) |
---|
29 | |
---|
30 | registerATCT(CaptchaField, PROJECTNAME) |
---|
Note: See
TracBrowser
for help on using the repository browser.