Package orm2 :: Package util :: Module datatypes :: Class pickle
[hide private]
[frames] | no frames]

Class pickle

source code

    object --+        
             |        
      property --+    
                 |    
datatypes.datatype --+
                     |
                    pickle

This datatype uses Python's pickle module to serialize (nearly) arbitrary Python objects into a string representation that is then stored in a regular database column. See http://localhost/Documentation/Python/Main/lib/module-pickle.html for details on pickling.

Instance Methods [hide private]
  __init__(self, pickle_protocol=HIGHEST_PROTOCOL, column=None, title=None, validators=(), has_default=False)
  __set_from_result__(self, ds, dbobj, value)
This method takes care of un-pickling the value stored in the datbase.
  __convert__(self, value)
Since we store the Python object 'as is', convert does nothing.
  sql_literal(self, dbobj)
This function takes care of converting the Python object into a serialized string representation.

Inherited from datatypes.datatype: __delete__, __get__, __init_dbclass__, __select_after_insert__, __select_this_column__, __set__, __setattr__, add_widget, check_dbobj, data_attribute_name, isset, widget_specs

Inherited from property: __getattribute__, __new__

Inherited from object: __delattr__, __hash__, __reduce__, __reduce_ex__, __repr__, __str__


Class Variables [hide private]

Inherited from datatypes.datatype: python_class, sql_literal_class

Inherited from property: fdel, fget, fset


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, pickle_protocol=HIGHEST_PROTOCOL, column=None, title=None, validators=(), has_default=False)
(Constructor)

source code 
Parameters:
Overrides: datatypes.datatype.__init__

__set_from_result__(self, ds, dbobj, value)

source code 
This method takes care of un-pickling the value stored in the datbase.
Overrides: datatypes.datatype.__set_from_result__

__convert__(self, value)

source code 
Since we store the Python object 'as is', convert does nothing.
Overrides: datatypes.datatype.__convert__

sql_literal(self, dbobj)

source code 
This function takes care of converting the Python object into a serialized string representation.
Returns:
SQL literal as a string.
Overrides: datatypes.datatype.sql_literal