Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common field #11

Open
sif77 opened this issue Jun 17, 2015 · 0 comments
Open

Common field #11

sif77 opened this issue Jun 17, 2015 · 0 comments

Comments

@sif77
Copy link

sif77 commented Jun 17, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants