June 2019
Beginner to intermediate
770 pages
19h 24m
English
It is helpful to store the shelve key as an attribute of a shelved object. Keeping the key in the object makes the object easier to delete or replace. Clearly, when creating an object, we'll start with a keyless version of the object until it's stored in the shelf. Once stored, the Python object needs to have a key attribute set so that each object in the memory contains a correct key.
When retrieving objects, there are two use cases. We might want a specific object that is known by the key. In this case, the shelf will map the key to the object. We might also want a collection of related objects not known by their keys, but perhaps known by the values of some other attributes. In this case, we'll discover ...
Read now
Unlock full access