Package pyamf :: Package adapters :: Module _google_appengine_ext_db :: Class DataStoreClassAlias
[hide private]
[frames] | no frames]

Class DataStoreClassAlias

source code


This class contains all the business logic to interact with Google's Datastore API's. Any db.Model or db.Expando classes will use this class alias for encoding/decoding.

We also add a number of indexes to the encoder context to aggressively decrease the number of Datastore API's that we need to complete.

Instance Methods [hide private]
 
_compile_base_class(self, klass) source code
 
getCustomProperties(self)
Overrride this to provide known static properties based on the aliased class.
source code
 
getEncodableAttributes(self, obj, codec=None)
Must return a dict of attributes to be encoded, even if its empty.
source code
 
createInstance(self, codec=None)
Creates an instance of the klass.
source code
 
getDecodableAttributes(self, obj, attrs, codec=None)
Returns a dictionary of attributes for obj that has been filtered, based on the supplied attrs.
source code

Inherited from alias.ClassAlias: __eq__, __hash__, __init__, __repr__, __str__, applyAttributes, checkClass, compile, is_compiled

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  KEY_ATTR = '_key'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_compile_base_class(self, klass)

source code 
Overrides: alias.ClassAlias._compile_base_class

getCustomProperties(self)

source code 

Overrride this to provide known static properties based on the aliased class.

Overrides: alias.ClassAlias.getCustomProperties
(inherited documentation)

getEncodableAttributes(self, obj, codec=None)

source code 

Must return a dict of attributes to be encoded, even if its empty.

Parameters:
  • codec - An optional argument that will contain the encoder instance calling this function.
Overrides: alias.ClassAlias.getEncodableAttributes
(inherited documentation)

createInstance(self, codec=None)

source code 

Creates an instance of the klass.

Returns:
Instance of self.klass.
Overrides: alias.ClassAlias.createInstance
(inherited documentation)

getDecodableAttributes(self, obj, attrs, codec=None)

source code 

Returns a dictionary of attributes for obj that has been filtered, based on the supplied attrs. This allows for fine grain control over what will finally end up on the object or not.

Parameters:
  • obj - The object that will recieve the attributes.
  • attrs - The attrs dictionary that has been decoded.
  • codec - An optional argument that will contain the decoder instance calling this function.
Returns:
A dictionary of attributes that can be applied to obj
Overrides: alias.ClassAlias.getDecodableAttributes
(inherited documentation)