Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from zope.interface import Interface
- from zope.interface import implementer
- from zope import schema
- class IContainer(Interface):
- parent = schema.Object(
- title=u'Parent container',
- schema=IContainer, # How can I do this, IContainer is not yet defined.
- required=False,
- default=None,
- )
- @implementer(IContainer)
- class Container(object):
- parent = schema.fieldproperty.FieldProperty(IContainer['parent'])
- def __init__(self, parent=None):
- self.parent = parent
- c1 = Container()
- c2 = Container(parent=c1)
Add Comment
Please, Sign In to add comment