Re: [Zope] Delete property woes in ZClasses
Hi Paul ! Paul Abrams wrote: I noticed that when you delete a property in a ZClass, it doesn't actually delete the property in **instances** of that ZClass! This leaves properties lying around where they can be inadvertently acquired, causing problems that are difficult to trace. Has anyone gotten bitten by this, or know of a solution? I solved it by adding this External Method, and calling all instances with it: #move_attribute?the_id=abstract def delete_attribute(self,the_id): self._delOb(the_id) BTW, I have also written an External Method that moves the attribute to a DTML Method: #move_attribute?the_attribute_id=abstract def move_attribute(self,the_attribute_id): attribute=str(getattr(self, the_attribute_id)) self._delOb(the_attribute_id) if attribute!="": self.manage_addDTMLMethod(the_attribute_id,file=" " + attribute) Regards, Maik Röder -- "The computing future is based on "cyberbodies" - self-contained, neatly-ordered, beautifully-laid-out collections of information, like immaculate giant gardens." The second coming - A manifesto. David Gelernter http://www.edge.org/3rd_culture/gelernter/gelernter_p1.html ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Delete property woes in ZClasses
Hi Paul ! Paul Abrams wrote: Thanks! I think the delete method will be ideal to patch my site. I also see how the move method can be *very* useful. Shall I write this up as a how-to? That would be great ! Perhaps you can also find a way to do this recursively ? Have a look at my recursive copier: http://zdp.zope.org/projects/zsnippet/snippets/DTMLTags/recursive_copier This does it the other way around, but it can be adopted to do what you need. It would be handy if you have many instances floating around. Maybe you can also do it easier with a ZCatalog search ? Best regards, Maik Röder -- "The computing future is based on "cyberbodies" - self-contained, neatly-ordered, beautifully-laid-out collections of information, like immaculate giant gardens." The second coming - A manifesto. David Gelernter http://www.edge.org/3rd_culture/gelernter/gelernter_p1.html ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Delete property woes in ZClasses
I noticed that when you delete a property in a ZClass, it doesn't actually delete the property in **instances** of that ZClass! This leaves properties lying around where they can be inadvertently acquired, causing problems that are difficult to trace. Has anyone gotten bitten by this, or know of a solution? Cheers, -Paul __ Do You Yahoo!? Get Yahoo! Mail Free email you can access from anywhere! http://mail.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )