Yeah, the new property type in Python 2.2 is pretty cool, but out of range for use under Zope at the moment. The ExtensionClass requirement for persistence eliminates using it with new style Python classes.

Plus... the Lars, the original poster, said he was a Python newbie and he certainly doesn't need to get lost wandering around in bleeding edge versions.

I think Zope 2.7 or 3.0 is supposed to support new style classes and persistence. But not today...

-Jeff


Leonardo Rochael Almeida wrote:
On Sat, 2003-01-18 at 17:44, Seb Bacon wrote:

Jeff Rush wrote:

I use a form of the following to compute dynamic titles for Zope
objects, where the 'title' attribute is the result of a method call.
Modifying it slightly for your case...

from ComputedAttribute import ComputedAttribute

Class B(A):
   def getMyObjects(self):
       ...
   myObjects = ComputedAttribute(lambda self: self.getMyObjects())

In Python 2.2 (which is unfortunately not yet an option unless you are using a bleeding edge Zope) you can also use the new property type:

I might be wrong but I believe class properties only work with new-style
classes, and I don't know if Zope ExtensionClass-based objects
qualify...

Cheers, Leo

_______________________________________________
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 )

Reply via email to