[Zope-dev] bug in manage_pasteObjects ??

Romain Slootmaekers romain at zzict.com
Fri Aug 29 04:16:53 EDT 2003


Romain Slootmaekers wrote:
> hi,
> 
> 
> after an object is copied & paste, the following method is called:
> 
> 
> def manage_afterClone(self, item):
>     """
>     """
> 
> 
> 
> 
> as it happens, both self and item refer to the same object.... which 
> severely limits the use of the method. You probably want a reference to 
> the original object from which this one was cloned.
> 
> I googled and found a mail with the same remarks posted in 1999:
> http://mail.python.org/pipermail/zope-dev/1999-November/002303.html
> 
> from which I copy the relevant part for your convenience:
> 
> <--------------- c &amp; p ----------------------->
> In lib/OFS/CopySupport.py
> In the function manage_pasteObjects
> the following line appears:
> 
>                 ob=ob._getCopy(self)
>                 ob.manage_afterClone(ob)
> 
> Passing ob as an argument doesn't make sense
> because the function is being called on ob,
> (so self is already ob)
> it would make more sense to to something along the lines of:
>         original_ob=ob
>                 ob=ob._getCopy(self)
>                 ob.manage_afterClone(original_ob)
> 
> </--------------- c &amp; p ----------------------->
> 
> but there's no follow- up, no reply, no fix. :(
> 
> Romain Slootmaekers
> 
> 
> 
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
> 
> 
http://collector.zope.org/Zope/1028

have fun,

Romain Slootmaekers





More information about the Zope-Dev mailing list