If I load an object which has several PersistentList attributes – are the lists automatically loaded in their entirety? Or does ZODB wait until I access an element of the list to load it? If the latter, does it load the entire list whenever an element is accessed, or only part of the list?
Share
Provided your elements inside the list are themselves inheriting from
persistent.Persistent, they will be loaded on demand.Primitive types and classes that do not inherit from
Persistent, however, are loaded into memory together with the PersistentList instance.PersistentList is basically a subclass of
UserList(andPersistent) that setsself._p_changedwhen altered, so that changes to the list are translated into a ZODB commit for it’s record.