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]
 
getAttrs(self, obj, codec=None)
Returns a tuple of lists, static and dynamic attrs to encode.
source code
 
getAttributes(self, obj, codec=None)
Returns a collection of attributes for an object.
source code
 
createInstance(self, codec=None)
Creates an instance of the klass.
source code
 
applyAttributes(self, obj, attrs, codec=None)
Applies the collection of attributes attrs to aliased object obj.
source code

Inherited from ClassAlias: __eq__, __hash__, __init__, __repr__, __str__

Inherited from ClassAlias (private): _getAttrs

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]

Inherited from ClassAlias: checkClass

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

Inherited from ClassAlias: attrs, metadata

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getAttrs(self, obj, codec=None)

source code 

Returns a tuple of lists, static and dynamic attrs to encode.

Parameters:
  • codec - An optional argument that will contain the en/decoder instance calling this function.
Overrides: ClassAlias.getAttrs

Since: 0.4

getAttributes(self, obj, codec=None)

source code 

Returns a collection of attributes for an object. Returns a tuple containing a dict of static and dynamic attributes

Parameters:
  • codec - An optional argument that will contain the en/decoder instance calling this function.
Overrides: ClassAlias.getAttributes
(inherited documentation)

createInstance(self, codec=None)

source code 

Creates an instance of the klass.

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

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

source code 

Applies the collection of attributes attrs to aliased object obj. It is mainly used when reading aliased objects from an AMF byte stream.

Parameters:
  • codec - An optional argument that will contain the en/decoder instance calling this function.
Overrides: ClassAlias.applyAttributes
(inherited documentation)