0

I want two content type like:

# 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,
    )

But have error: ImportError: cannot import name IContentTypeA

any idea for me? Thank you so much!

Mathias
  • 6,777
  • 2
  • 20
  • 32
mariozx
  • 21
  • 2
  • The traceback should be clear. You don't have a `IContentTypeA`class (interface) in your `content_type_b`. The naming is a little bit confusing. Please post the code of both modules. – Mathias Jun 20 '14 at 06:19
  • I found my problem and solution at here: http://stackoverflow.com/questions/12286692/circular-import-references-from-zope-schemas Thank you! – mariozx Jun 20 '14 at 06:51

0 Answers0