[Zope-dev] Re: Renaming a product

2003-06-18 Thread Philipp von Weitershausen
Clemens Robbenhaar wrote:
 The actual work is the transformation of instances of class "A.Foo" to
class "B.Foo"; to be on the safe side one would have to copy over all
attributes manually. If You want to try a fast and dirty solution, You
could try to write the new class into the '__class__' attribute of the
instance of the old class, making it an instance of the new class, but
I do not know it this really works.
Somebody correct me please, if I'm wrong, but

1. tinkering with __class__ is the only way to do this.
2. you can not tinker with __class__ of an ExtensionClass, i.e. all 
Persistent objects.

So, it is not doable, IIRC.

Phil

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


[Zope-dev] Re: Renaming a product

2003-06-18 Thread Morten W. Petersen
> Somebody correct me please, if I'm wrong, but
> 
> 1. tinkering with __class__ is the only way to do this.
> 2. you can not tinker with __class__ of an ExtensionClass, i.e. all 
> Persistent objects.

It's not easily doable, no.  I settled on converting each instance
(copying properties) from the old product name to the new, and
it worked.

Thanks for your help everybody.  :)

Regards,

Morten W. Petersen

--
Technologies: Zope, Linux, Python, HTML, CSS, PHP
Homepage: http://www.nidelven-it.no
Phone number: (+47) 45 44 00 69


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )