[Zope-dev] _delObject Method

2000-07-10 Thread Heine, Gregor

Hello!

Can anybody tell me, what the 'dp=1' attribute in the _delObject methods of
the ObjectManager (OFS/ObjectManager.py) and ZClassMethodsSheet
(ZClasses/Method.py) Class are for?
I haven't found any method call, where dp is set and the methods themselves
don't use it aswell.

I would like to use it as a switch for (not) calling the manage_beforeDelete
method, when the _delObject method is called by
CopySupport.manage_renameObject and CopySupport.manage_pasteObject. In these
cases, manage_beforeDelete would not be called. To me that seems to be
correct, because during a cut-paste and a rename operation the Objects are
not really deleted, they are just temporarily taken out of the object-tree
and then inserted again.
Are there any problems with that? Or is 'dp' used for another purpose in an
older or a newer version of Zope (I use Zope 2.1.6)?

-OFS/ObjectManager.py-line 277-
def _delObject(self, id, dp=1):
object=self._getOb(id)
if dp:
object.manage_beforeDelete(object, self)
self._objects=tuple(filter(lambda i,n=id: i['id']!=n,
self._objects))
self._delOb(id)
---

-OFS/CopySupport.py-line 225 and 259---
ob.aq_parent._delObject(id, 0)
---

Thanx,

Gregor!

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




RE: [Zope-dev] _delObject Method

2000-07-10 Thread Brian Lloyd

 Can anybody tell me, what the 'dp=1' attribute in the 
 _delObject methods of
 the ObjectManager (OFS/ObjectManager.py) and ZClassMethodsSheet
 (ZClasses/Method.py) Class are for?
 I haven't found any method call, where dp is set and the 
 methods themselves
 don't use it aswell.

 I would like to use it as a switch for (not) calling the 
 manage_beforeDelete
 method, when the _delObject method is called by
 CopySupport.manage_renameObject and 
 CopySupport.manage_pasteObject. In these
 cases, manage_beforeDelete would not be called. To me that seems to be
 correct, because during a cut-paste and a rename operation 
 the Objects are
 not really deleted, they are just temporarily taken out of 
 the object-tree
 and then inserted again.
 Are there any problems with that? 

Gregor - 

I think that what you are talking about is already 
implemented for 2.2...

Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )