On Mon, Aug 31, 2009 at 18:54, David Glick<[email protected]> wrote:
>> I have a Dexterity custom class. I decorate a method foo with @property
>> but inside the method 'self' is not acquisition wrapped anymore. I'm
>> sure the object is wrapped before my attempt to access ob.foo
>>
>> I'm sure it is not related to Dexterity but I mention it in case.
>>
>> So the question is: should I be surprised that it is not working?
>
> This is a known side effect of the @property decorator. Not sure what the
> best workaround is. Anyone?
Use ExtensionClass.ComputedAttribute instead:
from ExtensionClass import ComputedAttribute
@ComputedAttribute
def foo(self):
# self now remains Acquisition wrapped
--
Martijn Pieters
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers