tags:

views:

42

answers:

1

One to many relationships not working in ZODB as list is mutable.They say solution is Persistent Mapping or Persistent List or BTree.Can someone please tell me how is it exactly done

+1  A: 

I'm not sure I understand your question.

A PersistentMapping behaves just as a dictionary but is persistent. A PersistentList is just a that, a list that is persistent.

A BTree behaves also as a dictionary but it's optimized for huge numbers of objects. You shouldn't use PersistentMapping or PersistentList if you have to deal with many objects.

For ZODB relations you can use object references as you would normally do in Python.

ZODB even supports weak references if you need them.

There are other specialized packages, like z3c.relationfield, to deal with relations in ZODB, like for example if you need to search by relation but I never had the need to use them.

jdnavarro