Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

unexpected behavior modifying dict #8

Open
minskmaz opened this issue Nov 29, 2014 · 0 comments
Open

unexpected behavior modifying dict #8

minskmaz opened this issue Nov 29, 2014 · 0 comments

Comments

@minskmaz
Copy link

I just picked up mongopersist again. Wondering if you could provide a sanity check for me as I’m having some trouble replicating this:

type(dm.root['stephan'].friends)
<class 'mongopersist.serialize.PersistentDict'>
dm.root['stephan'].friends[u'roger'] = Person(u'Roger')
transaction.commit()
sorted(dm.root['stephan'].friends.keys())
[u'roger', u'roy']

Please review or try the code I’ve posted here —>

https://gist.github.com/anonymous/860d3fafee59f8b1bcfa

ALSO! Keep in mind it has a clear_mongo() function, the call of which I’ve commented out.

Here’s the terminal output I’m getting when I run this 2x:

(gis)vagrant@jdev:/projects/gis/src/nona.gis/src/nona/gis/engine$ python mptest.py
ADDING OBJECTS
{'54794e77dc2eb91992b45502': <main.File object at 0x2ae4398>}
(gis)vagrant@jdev:
/projects/gis/src/nona.gis/src/nona/gis/engine$ python mptest.py
{}

I am expecting the same output the second time (minus 'ADDING OBJECTS')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant