Plone内容类型关系循环

时间:2014-06-20 05:15:43

标签: plone content-type

我想要两种内容类型:

# in content_type_a.py
from content_type_b import IContentTypeB
class IContentTypeA(model.Schema):
    content_type_bs = RelationList(
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                object_provides=IContentTypeB.__identifier__
            ),
        ),
        required=False,
    )

# in content_type_b.py
from content_type_a import IContentTypeA
class IContentTypeB(model.Schema):
    content_type_as = RelationList(
        default=[],
        value_type=RelationChoice(
            source=ObjPathSourceBinder(
                object_provides=IContentTypeA.__identifier__
            ),
        ),
        required=False,
    )

但是有错误:ImportError:无法导入名称IContentTypeA

对我有什么想法? 非常感谢你!

0 个答案:

没有答案