Back to index

python3.2  3.2.2
Public Member Functions
dbpickle.DBPickler Class Reference

List of all members.

Public Member Functions

def persistent_id

Detailed Description

Definition at line 11 of file

Member Function Documentation

def dbpickle.DBPickler.persistent_id (   self,

Definition at line 13 of file

00014     def persistent_id(self, obj):
00015         # Instead of pickling MemoRecord as a regular class instance, we emit a
00016         # persistent ID.
00017         if isinstance(obj, MemoRecord):
00018             # Here, our persistent ID is simply a tuple, containing a tag and a
00019             # key, which refers to a specific record in the database.
00020             return ("MemoRecord", obj.key)
00021         else:
00022             # If obj does not have a persistent ID, return None. This means obj
00023             # needs to be pickled as usual.
00024             return None

Here is the caller graph for this function:

The documentation for this class was generated from the following file: