Back to index

plone3  3.1.7
schemata.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # ATContentTypes http://plone.org/products/atcontenttypes/
00004 # Archetypes reimplementation of the CMF core types
00005 #
00006 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
00007 # Copyright (c) 2003-2006 AT Content Types development team
00008 #
00009 # This software is subject to the provisions of the Zope Public License,
00010 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
00011 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00012 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00013 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00014 # FOR A PARTICULAR PURPOSE
00015 #
00016 ##############################################################################
00017 """
00018 
00019 """
00020 __author__  = ''
00021 __docformat__ = 'restructuredtext'
00022 
00023 from Products.Archetypes.atapi import Schema
00024 from Products.Archetypes.atapi import StringField
00025 from Products.Archetypes.atapi import IdWidget
00026 from Products.Archetypes.atapi import StringWidget
00027 from Products.ATContentTypes.permission import ChangeTopics
00028 
00029 from Products.ATContentTypes import ATCTMessageFactory as _
00030 
00031 ###
00032 # AT Base Criterion
00033 ###
00034 
00035 ATBaseCriterionSchema = Schema((
00036     StringField('id',
00037                 required=1,
00038                 mode="r",
00039                 default=None,
00040                 write_permission=ChangeTopics,
00041                 widget=IdWidget(
00042                     label=_(u'label_short_name', default=u'Short Name'),
00043                     description=_(u'help_shortname',
00044                                   default=u"Should not contain spaces, underscores or mixed case. "
00045                                            "Short Name is part of the item's web address."),
00046                     visible={'view' : 'invisible'}
00047                     ),
00048                 ),
00049     StringField('field',
00050                 required=1,
00051                 mode="r",
00052                 accessor="Field",
00053                 write_permission=ChangeTopics,
00054                 default=None,
00055                 widget=StringWidget(
00056                     label=_(u'label_criteria_field_name', default=u'Field name'),
00057                     description=_(u'help_criteria_field_name',
00058                                   default=u"Should not contain spaces, underscores or mixed case. "
00059                                            "Short Name is part of the item's web address.")
00060                     ),
00061                 ),
00062     ))