Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-16 Thread Laurence Rowe
2009/12/17 Mikko Ohtamaa : > Hi, > > I need to have little clarification should properties work on > Persistent objects. I am running ZODB 3.8.4 on Plone 3.3. > > I am using plone.behavior and adapters to retrofit objects with a new > behavior (HeaderBehavior object). This object is also editable t

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-16 Thread Martin Aspeli
Laurence Rowe wrote: > 2009/12/17 Mikko Ohtamaa: >> Hi, >> >> I need to have little clarification should properties work on >> Persistent objects. I am running ZODB 3.8.4 on Plone 3.3. >> >> I am using plone.behavior and adapters to retrofit objects with a new >> behavior (HeaderBehavior object). T

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-17 Thread Mikko Ohtamaa
> > This isn't right: a z3c.form form is just a view like any other. It is > looked up on the context and the request. In Dexterity (which I assume > you're using?), that's going to be the content object. Sorry, I think I mixed with zope.formlib. In any case I hope to find the answer to the origna

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-17 Thread Martin Aspeli
Mikko Ohtamaa wrote: >> This isn't right: a z3c.form form is just a view like any other. It is >> looked up on the context and the request. In Dexterity (which I assume >> you're using?), that's going to be the content object. > > Sorry, I think I mixed with zope.formlib. In any case I hope to find

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-17 Thread Mikko Ohtamaa
> That code is insane. Really insane. It's generating classes and doing > custom adapter factories that inject a _v_ variable into a persistent > object temporarily. I wouldn't try to copy it at all. I would run away. But I thought this was *the* Zope way and the brightest minds in the community h

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-17 Thread Jim Fulton
On Wed, Dec 16, 2009 at 7:12 PM, Mikko Ohtamaa wrote: > I need to have little clarification should properties work on > Persistent objects. Properties work with persistent objects with one limitation that I'm aware of. The __setattribute__ method used by the persistent base class assumes that any

Re: [ZODB-Dev] Python properties on Persistent objects

2009-12-17 Thread Mikko Ohtamaa
> > Properties work with persistent objects with one limitation that I'm aware of. > The __setattribute__ method used by the persistent base class assumes > that any attribute assignment modifies the object's persistent state. > A property > that doesn't modify state or that modifies volatile state