Re: Descriptors and zodb

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-Fjog_9UyY1=XHRpv-HCRb6Zd1g4tqSDOHc_+p5DMQxJ1A@mail.gmail.com>
On Thu, Apr 14, 2016 at 1:56 AM, Lars van Gemerden <[email protected]> wrote:
> i am trying to figure out whether it is poosible to use attributes with descriptors in zodb persistent subclasses,

Yes, with care.

> and if so, is there anything i need to do extra or take into account?

Yes, you have to mark objects as changed.  You can do this by setting
ob._p_changed to True.

> the descriptors i made currently write directly ro __dict__, so it is bypassing some mechanisms.

Yes. Normally, the Persistent base class marks objects objects as
changed on your behalf by observing attribute changes.  If you write
directly to __dict__ then you have to take responsibility for marking
an object as changes.

Jim

-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.