Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__ and acquisition)

2002-06-09 Thread Nicholas Henke
On Friday 07 June 2002 06:44 pm, Julien Jalon wrote: Beautiful -- thanks a ton ~~ nic > > import ExtensionClass > import Acquisition > > class Outer(ExtensionClass.Base): > > thing = ('help', 'donthelp') > > class Inner_base(Acquisition.Implicit): > # here the real declaration of the

Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__ and acquisition)

2002-06-07 Thread Julien Jalon
Nicholas Henke <[EMAIL PROTECTED]> wrote: >Given the following code: > I can see why access to self.thing fails in Inner::__setattr__, but the >question is how do I do that -- can I not use __setattr__ and have to use a >setAttr that is accessed via O.I.setAttr('help','me rhonda') ? > >Nic > >i

Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__and acquisition)

2002-06-06 Thread Leonardo Rochael Almeida
The only way I know is to put a wrapped object in a ._v_attribute, which means a volatile attribute. You can put, for instance, a wrapped self in, for instance self._v_alterEgo, this way you can do wrapped transversals thru it. How do you get a wrapped self to put there is an exercise left to th

Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__and acquisition)

2002-06-05 Thread Casey Duncan
Why rely on __setattr__? Why not just create a regular setter function that can use acquisition instead of being clever? -Casey On Wed, 2002-06-05 at 15:24, Erik A. Dahl wrote: > Yep. This is a problem for me I'm trying to find something through > acquisition in my __setattr__. Self is total

Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__and acquisition)

2002-06-05 Thread Erik A. Dahl
Yep. This is a problem for me I'm trying to find something through acquisition in my __setattr__. Self is totally unwrapped. Can anyone think of a creative solution? aq_acquire doesn't help because self is not a wrapped object. :( Can't pass in the object I want because the whole point o

Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__and acquisition)

2002-06-05 Thread Shane Hathaway
Nicholas Henke (by way of Nicholas Henke ) wrote: > Given the following code: > I can see why access to self.thing fails in Inner::__setattr__, but the > question is how do I do that -- can I not use __setattr__ and have to use a > setAttr that is accessed via O.I.setAttr('help','me rhonda') ?

Re: [Zope-dev] __setattr__ --> Zope Crash :S

2000-08-09 Thread Chris Withers
Steve Alexander wrote: > > The application, ./python.exe, generated an application error > > The error occurred on 8/ 9/2000 @ 11:48:41.189 > > The exception generated was c0fd at address 7800118b (lock) > > > > DrWatson also said this was a Stack Overflow error. > > > > Now what am I doing w

Re: [Zope-dev] __setattr__

2000-08-09 Thread Chris Withers
Chris Withers wrote: > def __setattr__(self,name,value): > self.__setitem__(self,name,value) Erk... first problem, why does a Zope __setattr__ take four arguments?! DataBlob.py, line 62, in __setattr__: > Error Type: TypeError > Error Value: too many arguments; expected 3, got 4 Do eit

Re: [Zope-dev] __setattr__

2000-08-09 Thread Chris Withers
Chris Withers wrote: At Steve Alexander's suggestion, I'm going to try subclassing DataBlob from PersistentMapping. So now I need to add attribute support... How do the following three methods sound: def __getattr__(self,name): try: return PersistentMapping.__getattr__