[ZODB-Dev] How to cause commit with non-PersistentDict?

Claudiu Saftoiu csaftoiu at gmail.com
Tue Jun 19 20:22:43 UTC 2012


Hello all,

Say I have a:

    class Foo(Persistent):
        def __init__(self, bar):
            self.my_dict = PersistentDict({'keyis': bar})
        def update_it(self, bar):
            self.my_dict['keyis'] = bar

If I want to use a `dict`, instead (it seems it might be faster for my
larger example), how would I cause a change to the dict to
be committed? Is there any way other than this?

    class Foo(Persistent):
        def __init__(self, bar):
            self.my_dict = {'keyis': bar}
        def update_it(self, bar):
            self.my_dict['keyis'] = bar
            self.my_dict = dict(self.my_dict)

Thanks,
- Claudiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zodb-dev/attachments/20120619/36ce3e5b/attachment.html>


More information about the ZODB-Dev mailing list