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) Returns a `tuple` containing a dict of static and dynamic attributes for an object to encode. | 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 `ClassAlias`: `__eq__`, `__hash__`, `__init__`, `__repr__`, `__str__`, `applyAttributes`, `checkClass`, `compile`, `getProxiedAttribute`, `is_compiled` Inherited from `ClassAlias` (private): `_checkExternal`, `_finalise_compile` Inherited from `object`: `__delattr__`, `__getattribute__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

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: ClassAlias._compile_base_class

### getCustomProperties(self)

source code

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

Overrides: ClassAlias.getCustomProperties
  (inherited documentation)

### getEncodableAttributes(self, obj, codec=None)

source code

Returns a `tuple` containing a dict of static and dynamic attributes for an object to encode.

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

### createInstance(self, codec=None)

source code

Creates an instance of the klass.

Returns:
  Instance of `self.klass`.
Overrides: 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 reference object.
  - `attrs` - The attrs dictionary that has been decoded.
  - `codec` - An optional argument that will contain the codec instance calling this function.
Returns:
  A dictionary of attributes that can be applied to `obj`
Overrides: ClassAlias.getDecodableAttributes
  (inherited documentation)