Commit cfc495eb authored by Jim Fulton's avatar Jim Fulton

Added logic to get copied ZClasses to be accessed through their

containers. This is necessary to satisfy expectations of python-script
security machinery.
parent d45bf98e
...@@ -12,7 +12,8 @@ Let's make sure we can load old ZClasses: ...@@ -12,7 +12,8 @@ Let's make sure we can load old ZClasses:
>>> from Zope2.ClassFactory import ClassFactory >>> from Zope2.ClassFactory import ClassFactory
>>> db.classFactory = ClassFactory >>> db.classFactory = ClassFactory
>>> conn = db.open() >>> conn = db.open()
>>> ac = conn.root()['Application'].ac >>> app = conn.root()['Application']
>>> ac = app.ac
>>> ac.eek() >>> ac.eek()
'xxx' 'xxx'
>>> ac.y = 2 >>> ac.y = 2
......
...@@ -71,7 +71,7 @@ Let's commit our changes: ...@@ -71,7 +71,7 @@ Let's commit our changes:
>>> import transaction >>> import transaction
>>> transaction.commit() >>> transaction.commit()
We can access the class in another connection. We'll ise an explicit We can access the class in another connection. We'll use an explicit
transaction manager so that we can use the second connection without transaction manager so that we can use the second connection without
creating a separate thread: creating a separate thread:
...@@ -107,8 +107,11 @@ We can copy instances: ...@@ -107,8 +107,11 @@ We can copy instances:
>>> c3 is app.c2.aq_base >>> c3 is app.c2.aq_base
False False
>>> c3.eek() >>> app.c3 = c3
>>> app.c3.eek()
'******************************************' '******************************************'
But the copies share a common class:
>>> c3.__class__ is app.c2.__class__ >>> c3.__class__ is app.c2.__class__
True True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment