Ejemplo n.º 1
0
class IRegister(Interface):
    """Trivial sample registry."""

    id = Id(
        title=u"Identifier",
        description=u"Some identifier that can be checked.",
        required=True,
    )
Ejemplo n.º 2
0
class ICommonAddInformation(Interface):
    """
    Common information for add forms
    """

    content_factory = GlobalObject(
        title=u"Content factory",
        description=u"""
        An object to call to create new content objects.

        This attribute isn't used if a class is specified that
        implements createAndAdd.""",
        required=False
        )

    content_factory_id = Id(
        title=u"Content factory id",
        description=u"A factory id to create new content objects",
        required = False,
        )

    arguments = Tokens(
        title=u"Arguments",
        description=u"""
        A list of field names to supply as positional arguments to the
        factory.""",
        required=False,
        value_type=PythonIdentifier()
        )

    keyword_arguments = Tokens(
        title=u"Keyword arguments",
        description=u"""
        A list of field names to supply as keyword arguments to the
        factory.""",
        required=False,
        value_type=PythonIdentifier()
        )

    set_before_add = Tokens(
        title=u"Set before add",
        description=u"""
        A list of fields to be assigned to the newly created object
        before it is added.""",
        required=False,
        value_type=PythonIdentifier(),
        )

    set_after_add = Tokens(
        title=u"Set after add",
        description=u"""
        A list of fields to be assigned to the newly created object
        after it is added.""",
        required=False,
        value_type=PythonIdentifier()
        )
Ejemplo n.º 3
0
class ISchemaInfo(Interface):
    """Parameter schema for the schema directive
    """

    name = TextLine(
        title=u"The schema name",
        description=u"This is a descriptive name for the schema.",
    )

    id = Id(title=u"The unique id for the schema")
Ejemplo n.º 4
0
class IPermissionDirective(Interface):
    """Define a new security object."""

    id = Id(title=u"ID",
            description=u"ID as which this object will be known and used.",
            required=True)

    title = MessageID(title=u"Title",
                      description=u"Provides a title for the object.",
                      required=True)

    description = MessageID(
        title=u"Description",
        description=u"Provides a description for the object.",
        required=False)
Ejemplo n.º 5
0
class IAddMenuItemDirective(IMenuItem):
    """Define an add-menu item"""

    for_ = GlobalInterface(
        title=u"Interface",
        description=u"The interface the menu items are defined for",
        required=False)

    class_ = GlobalObject(title=u"Class",
                          description=u"""
        A class to be used as a factory for creating new objects""",
                          required=False)

    factory = Id(
        title=u"Factory",
        description=u"A factory id for creating new objects",
        required=False,
    )

    view = TextLine(
        title=u"Custom view name",
        description=u"The name of a custom add view",
        required=False,
    )

    menu = MenuField(
        title=u"Menu name",
        description=u"The (name of the) menu the items are defined for",
        required=False,
    )

    layer = GlobalInterface(
        title=u"The layer the custom view is declared for",
        description=u"The default layer for which the custom view is "
        u"applicable. By default it is applied to all layers.",
        required=False)