当前位置: 首页>>代码示例>>Python>>正文


Python ATContentTypeSchema.copy方法代码示例

本文整理汇总了Python中Products.ATContentTypes.content.schemata.ATContentTypeSchema.copy方法的典型用法代码示例。如果您正苦于以下问题:Python ATContentTypeSchema.copy方法的具体用法?Python ATContentTypeSchema.copy怎么用?Python ATContentTypeSchema.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.ATContentTypes.content.schemata.ATContentTypeSchema的用法示例。


在下文中一共展示了ATContentTypeSchema.copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_finalize_schema_additional_hide

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
    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)
开发者ID:4teamwork,项目名称:ftw.contentpage,代码行数:9,代码来源:test_finalize_schema.py

示例2: test_finalize_schema_do_not_hide

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
    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)
开发者ID:4teamwork,项目名称:ftw.contentpage,代码行数:9,代码来源:test_finalize_schema.py

示例3: test_finalize_schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
    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)
开发者ID:4teamwork,项目名称:ftw.contentpage,代码行数:13,代码来源:test_finalize_schema.py

示例4: Schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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'
开发者ID:BGCX261,项目名称:zmetadata-svn-to-git,代码行数:33,代码来源:Logs.py

示例5: Remark

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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

开发者ID:4teamwork,项目名称:ftw.book,代码行数:31,代码来源:remark.py

示例6: of

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
                                    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(
开发者ID:jensens,项目名称:Products.PloneFormGen,代码行数:33,代码来源:fieldsBase.py

示例7: Schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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=_(
开发者ID:RedTurtle,项目名称:Products.PloneSurvey,代码行数:33,代码来源:schemata.py

示例8: Schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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",
             ),
开发者ID:collective,项目名称:Products.EventRegistration,代码行数:33,代码来源:registerable_event.py

示例9: Schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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,
开发者ID:plone,项目名称:Products.ATContentTypes,代码行数:33,代码来源:document.py

示例10:

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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',
开发者ID:collective,项目名称:collective.geo.geoserver,代码行数:33,代码来源:geoquery.py

示例11: items

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
     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):
    """
开发者ID:4teamwork,项目名称:simplelayout.types.common,代码行数:33,代码来源:paragraph.py

示例12: IATUnifiedFolder

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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
开发者ID:Vinsurya,项目名称:Plone,代码行数:33,代码来源:folder.py

示例13: AnnotationStorage

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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
开发者ID:plone,项目名称:plone.app.blob,代码行数:33,代码来源:content.py

示例14: Schema

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
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."""
开发者ID:abstract-open-solutions,项目名称:abstract.widgets.multitree,代码行数:32,代码来源:testcontent.py

示例15: Harvester

# 需要导入模块: from Products.ATContentTypes.content.schemata import ATContentTypeSchema [as 别名]
# 或者: from Products.ATContentTypes.content.schemata.ATContentTypeSchema import copy [as 别名]
        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'
开发者ID:BGCX261,项目名称:zmetadata-svn-to-git,代码行数:33,代码来源:Harvester.py


注:本文中的Products.ATContentTypes.content.schemata.ATContentTypeSchema.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。