本文整理汇总了Python中Products.ATContentTypes.content.schemata.ATContentTypeSchema类的典型用法代码示例。如果您正苦于以下问题:Python ATContentTypeSchema类的具体用法?Python ATContentTypeSchema怎么用?Python ATContentTypeSchema使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ATContentTypeSchema类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_finalize_schema_additional_hide
def test_finalize_schema_additional_hide(self):
schema = ATContentTypeSchema.copy()
finalize(schema, hide=['title'])
self.assertEquals(ManagePortal, schema['title'].write_permission)
self.assertEquals({'view': 'invisible', 'edit': 'invisible'},
schema['title'].widget.visible)
示例2: test_finalize_schema_do_not_hide
def test_finalize_schema_do_not_hide(self):
schema = ATContentTypeSchema.copy()
finalize(schema, show=['subject'])
self.assertNotEqual(ManagePortal, schema['subject'].write_permission)
self.assertNotEquals({'view': 'invisible', 'edit': 'invisible'},
schema['subject'].widget.visible)
示例3: test_finalize_schema
def test_finalize_schema(self):
schema = ATContentTypeSchema.copy()
finalize(schema)
for name in DEFAULT_TO_HIDE:
if name in schema:
self.assertEquals(ManagePortal, schema[name].write_permission)
self.assertEquals({'view': 'invisible', 'edit': 'invisible'},
schema[name].widget.visible)
self.assertTrue(schema['excludeFromNav'].default)
示例4: Schema
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.CMFCore import permissions
##code-section module-header #fill in your manual code here
##/code-section module-header
schema = Schema((
),
)
##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema
#Logs_schema = BaseFolderSchema.copy() + schema.copy()
Logs_schema = ATContentTypeSchema.copy() + schema.copy()
##code-section after-schema #fill in your manual code here
##/code-section after-schema
class Logs(BaseFolder):
"""
"""
security = ClassSecurityInfo()
__implements__ = (getattr(BaseFolder,'__implements__',()),)
# This name appears in the 'add' box
archetype_name = 'Logs'
meta_type = 'Logs'
portal_type = 'Logs'
示例5: Remark
from AccessControl import ClassSecurityInfo
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from ftw.book.config import PROJECTNAME
from ftw.book.interfaces import IRemark
from ftw.contentpage.content import textblock
from ftw.contentpage.content.schema import finalize
from zope.interface import implements
try:
from Products.LinguaPlone import public as atapi
except ImportError:
from Products.Archetypes import atapi
remark_schema = ATContentTypeSchema.copy() + \
textblock.default_schema.copy()
remark_schema['title'].required = False
remark_schema['title'].searchable = 0
finalize(remark_schema, hide=['description', 'showTitle'])
class Remark(textblock.TextBlock):
"""A simplelayout block used for comments
"""
security = ClassSecurityInfo()
implements(IRemark)
schema = remark_schema
示例6: of
default=u"Options Vocabulary"),
description=_(u'help_fgtvocabulary_text', default=u"""
A TALES expression that will be evaluated when the form is displayed
to get the field options.
Leave empty if unneeded.
Your TALES expression should evaluate as a list of (key, value) tuples.
PLEASE NOTE: errors in the evaluation of this expression will cause
an error on form display.
"""),
size=70,
),
)
# establish a bare baseline
# only label field uses this without change
BareFieldSchema = ATContentTypeSchema.copy()
BareFieldSchema['title'].searchable = False
BareFieldSchema['title'].widget.label = _(u'label_fieldlabel_text', default=u'Field Label')
BareFieldSchema['description'].searchable = False
BareFieldSchema['description'].widget.label = _(u'label_fieldhelp_text', default=u'Field Help')
BareFieldSchema['description'].widget.description = None
###
# BaseFieldSchema -- more common baseline
# Used as a base schema for several fields
BaseFieldSchema = BareFieldSchema.copy() + Schema((
BooleanField('required',
searchable=0,
required=0,
widget=BooleanWidget(
示例7: Schema
from Products.Archetypes.atapi import TextAreaWidget
from Products.Archetypes.atapi import TextField
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.lib.constraintypes \
import ConstrainTypesMixinSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.PloneSurvey import PloneSurveyMessageFactory as _
from Products.PloneSurvey.config import NOTIFICATION_METHOD
from Products.PloneSurvey.config import TEXT_INPUT_TYPE
from Products.PloneSurvey.config import SELECT_INPUT_TYPE
from Products.PloneSurvey.config import TEXT_LOCATION
from Products.PloneSurvey.config import COMMENT_TYPE
from Products.PloneSurvey.config import LIKERT_OPTIONS
SurveySchema = ATContentTypeSchema.copy() + ConstrainTypesMixinSchema + Schema((
TextField(
'body',
searchable=1,
required=0,
schemata="Introduction",
default_content_type='text/html',
default_output_type='text/html',
allowable_content_types=('text/plain',
'text/structured',
'text/html', ),
widget=RichWidget(
label=_('label_introduction',
default=u"Introduction"),
description=_(
示例8: Schema
from Products.Archetypes.public import ReferenceField
from Products.Archetypes.public import BooleanField
from Products.Archetypes.public import BooleanWidget
from Products.Archetypes.public import registerType
from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget
from Products.EventRegistration import config
from Products.EventRegistration.utils import getPropSheet
from Products.ATContentTypes.configuration import zconf
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.permission import ChangeEvents
from Products.ATContentTypes.content import base
from Products.ATContentTypes.lib.constraintypes import ConstrainTypesMixinSchema
RegisterableEventSchema = ATContentTypeSchema.copy() + ConstrainTypesMixinSchema + Schema(
(
DateTimeField('startDate',
required=True,
searchable=False,
accessor='start',
write_permission=ChangeEvents,
default_method=DateTime,
languageIndependent=True,
widget=CalendarWidget(
description="",
description_msgid="help_event_start",
label="Event Starts",
label_msgid="label_event_start",
i18n_domain="plone",
),
示例9: Schema
from Products.ATContentTypes.content.base import registerATCT
from Products.ATContentTypes.content.base import translateMimetypeAlias
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.interfaces import IATDocument
from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFCore.permissions import View
from Products.CMFCore.utils import getToolByName
from Products.GenericSetup.interfaces import IDAVAware
from types import TupleType
from zope.interface import implementer
from ZPublisher.HTTPRequest import HTTPRequest
ATDocumentSchema = ATContentTypeSchema.copy() + Schema(
(
TextField(
"text",
required=False,
searchable=True,
primary=True,
storage=AnnotationStorage(migrate=True),
validators=("isTidyHtmlWithCleanup",),
# validators=('isTidyHtml',),
default_output_type="text/x-html-safe",
widget=TinyMCEWidget(
description="",
label=_(u"label_body_text", default=u"Body Text"),
rows=25,
allow_file_upload=zconf.ATDocument.allow_document_upload,
示例10:
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata
from Products.ATContentTypes.content.base import ATCTContent
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from collective.geo.geoserver import geoMessageFactory as _
from collective.geo.geoserver.config import PROJECTNAME
from collective.geo.geoserver.interfaces import IGeoQuery
from AccessControl import ClassSecurityInfo
from Products.CMFCore import permissions
from Products.CMFCore.utils import getToolByName
GeoQuerySchema = ATContentTypeSchema.copy() + atapi.Schema((
atapi.StringField(
'layer',
required=True,
searchable=False,
vocabulary_factory='layers_vocabulary',
widget=atapi.SelectionWidget(
label=_(u'label_layer', default='Layer'),
description=_(
u'help_layer', default=u'Select a layer from the list.'
),
),
),
atapi.StringField(
'srid',
示例11: items
atapi.BooleanField('teaserblock',
schemata='settings',
default=0,
widget=atapi.BooleanWidget(description = "teaser blocks shows their related items (ex. for frontpage)",
description_msgid = "simplelayout_help_teaserblock",
label = "Tick if this block is a teaser",
label_msgid = "simplelayout_label_teaserblock",
i18n_domain = "simplelayout",
)),
),
)
##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema
paragraph_schema = ATContentTypeSchema.copy() + \
schema.copy() + textSchema.copy() + imageSchema.copy()
paragraph_schema['excludeFromNav'].default = True
paragraph_schema['title'].required = False
finalize_simplelayout_schema(paragraph_schema)
paragraph_schema['description'].widget.visible = {'edit': 0, 'view': 0}
paragraph_schema['title'].searchable = 0
paragraph_schema.moveField('teaserblock',before="relatedItems")
paragraph_schema['text'].widget.filter_buttons = ('image', )
##code-section after-schema #fill in your manual code here
##/code-section after-schema
class Paragraph(ATDocumentBase):
"""
示例12: IATUnifiedFolder
from Products.ATContentTypes.interface import IATBTreeFolder
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import NextPreviousAwareSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.lib.constraintypes import \
ConstrainTypesMixinSchema
from Products.ATContentTypes.content.base import ATCTFolderMixin
from Products.ATContentTypes.content.base import registerATCT
from plone.app.folder import packageName
from plone.app.folder.base import BaseBTreeFolder
from plone.app.folder.bbb import IArchivable, IPhotoAlbumAble
from plone.app.folder.bbb import folder_implements
ATFolderSchema = ATContentTypeSchema.copy() + \
ConstrainTypesMixinSchema.copy() + NextPreviousAwareSchema.copy()
finalizeATCTSchema(ATFolderSchema, folderish=True, moveDiscussion=False)
class IATUnifiedFolder(IATFolder):
""" marker interface for the new, unified folders """
class ATFolder(ATCTFolderMixin, BaseBTreeFolder):
""" a folder suitable for holding a very large number of items """
implements(IATUnifiedFolder, IATBTreeFolder, IArchivable, IPhotoAlbumAble)
__implements__ = folder_implements
schema = ATFolderSchema
示例13: AnnotationStorage
from Products.MimetypesRegistry.common import MimeTypeException
from ZODB.POSException import ConflictError
from zope.event import notify
from zope.interface import implementer
from zope.lifecycleevent import ObjectCreatedEvent
from zope.lifecycleevent import ObjectModifiedEvent
try:
from Products.LinguaPlone.public import registerType
registerType # make pyflakes happy...
except ImportError:
from Products.Archetypes.atapi import registerType
ATBlobSchema = ATContentTypeSchema.copy()
ATBlobSchema['title'].storage = AnnotationStorage()
# titles not required for blobs, because we'll use the filename if missing
ATBlobSchema['title'].required = False
finalizeATCTSchema(ATBlobSchema, folderish=False, moveDiscussion=False)
ATBlobSchema.registerLayer('marshall', BlobMarshaller())
try:
from Products.CMFCore.CMFCatalogAware import WorkflowAware
WorkflowAware # make pyflakes happy...
# CMF 2.2 takes care of raising object events for old-style factories
hasCMF22 = True
except ImportError:
hasCMF22 = False
示例14: Schema
from Products.ATContentTypes import ATCTMessageFactory as _
from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.content.base import ATCTContent
from Products.ATContentTypes.content.base import registerATCT
from Products.Archetypes.atapi import Schema, LinesField, DisplayList
from zope.interface import implements
from my.test.content.interfaces import IATTestContent
from abstract.widgets.multitree.widget import MultiTreeWidget
from AccessControl import ClassSecurityInfo
ATTestContentSchema = ATContentTypeSchema.copy() + Schema((
LinesField('myfield',
widget=MultiTreeWidget(
label=_(u'My Label'),
description=_(u'My long description My long description My long description My long description '),
singleshot_overlay=True,
sources=[('my.vocabolary.source',_(u"Source1")),('my.vocabolary.source2',_(u"Source2"))])),
))
finalizeATCTSchema(ATTestContentSchema)
class ATTestContent(ATCTContent):
"""A page in the site. Can contain rich text."""
示例15: Harvester
default = 'No',
widget=SelectionWidget
(
label='Publish Harvested Metadata',
),
vocabulary=['Yes','No']
),
),
)
##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema
#Harvester_schema = BaseSchema.copy() + schema.copy()
Harvester_schema = ATContentTypeSchema.copy() + schema.copy()
##code-section after-schema #fill in your manual code here
##/code-section after-schema
class Harvester(BaseContent):
"""
"""
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)
# This name appears in the 'add' box
archetype_name = 'Harvester'
meta_type = 'Harvester'
portal_type = 'Harvester'