Skip to content

Common field #11

@sif77

Description

@sif77

I need to use common fields with multiple content types.

I read schema.txt, but it does not work.

File my.project.basecontent.py :

class IBaseContent(Interface):
test1 = zope.schema.TextLine(title=u"Test 1")
test2 = zope.schema.TextLine(title=u"Test 2")

File my.project.mycontenttype.py :
...
class IMyContentType(model.Schema, IImageScaleTraversable):
model.load("models/mycontenttype.xml")
...

File my.project.models/mycontenttype.xml :

<schema based-on="my.project.basecontent.IBaseContent">

    <field name="field1" type="zope.schema.TextLine">
        <title i18n:translate="">Field 1</title>
        <description />
        <required>True</required>
    </field>
    <field name="field2" type="zope.schema.TextLine">
        <title i18n:translate="">Field 2</title>
        <description />
        <required>True</required>
    </field>

</schema>

I can see field1 and field2 but none of common fields (test1, ...)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions