How to implement Persistent List or Persistent Mapping in ZODB
1 answer
I'm not sure I understand your question.
A PersistentMapping behaves like a dictionary but is persistent. PersistentList is just a list that is persistent.
A BTree behaves like a dictionary, but is optimized for a huge number of objects. You shouldn't use PersistentMapping or PersistentList if you have to deal with many objects.
For ZODB relationships, you can use object references as you would normally in Python.
ZODB even supports weak links if you need them.
There are other specialized packages like z3c.relationfield for dealing with relationships in ZODB, for example if you need to search by relationships, but I've never needed to use them.
+5
a source to share