[Zope3-checkins] CVS: Zope3/src/zope/app - location.py:1.1.2.6

Jim Fulton jim at zope.com
Thu Sep 11 07:32:01 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv1977/src/zope/app

Modified Files:
      Tag: parentgeddon-branch
	location.py 
Log Message:
Got zope running with global principals

=== Zope3/src/zope/app/location.py 1.1.2.5 => 1.1.2.6 ===
--- Zope3/src/zope/app/location.py:1.1.2.5	Tue Sep  9 17:45:07 2003
+++ Zope3/src/zope/app/location.py	Thu Sep 11 06:31:30 2003
@@ -22,6 +22,7 @@
 from zope.app.interfaces.traversing import IPhysicallyLocatable
 from zope.app.interfaces.traversing import IContainmentRoot
 from zope.app.interfaces.traversing import ITraverser
+from zope.proxy import removeAllProxies
 
 import cPickle
 import tempfile
@@ -33,6 +34,20 @@
     zope.interface.implements(ILocation)
 
     __parent__ = __name__ = None
+
+def locate(object, parent, name=None):
+    """Locate an object in another
+
+    This method should only be called from trusted code, because it
+    sets attributes that are normally unsettable.
+    
+    """
+
+    object = removeAllProxies(object)
+    object.__parent__ = parent
+    object.__name__ = name
+    
+
 
 def LocationIterator(object):
     while object is not None:




More information about the Zope3-Checkins mailing list