Package oauth2client :: Module appengine :: Class CredentialsProperty
[hide private]
[frames] | no frames]

Class CredentialsProperty

source code


App Engine datastore Property for Credentials.

Utility property that allows easy storage and retrieval of
oath2client.Credentials

Instance Methods [hide private]
 
get_value_for_datastore(self, model_instance)
Datastore representation of this property.
source code
 
make_value_from_datastore(self, value)
Native representation of this property.
source code
 
validate(self, value)
Assert that provided value is compatible with this property.
source code

Inherited from google.appengine.ext.db.Property: __get__, __init__, __property_config__, __set__, datastore_type, default_value, empty, get_updated_value_for_datastore, make_value_from_datastore_index_value

Inherited from google.appengine.ext.db.Property (private): _attr_name, _require_parameter

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

Class Variables [hide private]
  data_type = Credentials
str(object) -> string

Inherited from google.appengine.ext.db.Property: creation_counter

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

get_value_for_datastore(self, model_instance)

source code 
Datastore representation of this property.

Looks for this property in the given model instance, and returns the proper
datastore representation of the value that can be stored in a datastore
entity.  Most critically, it will fetch the datastore key value for
reference properties.

Some properies (e.g. DateTimeProperty, UserProperty) optionally update their
value on every put(). This call must return the current value for such
properties (get_updated_value_for_datastore returns the new value).

Args:
  model_instance: Instance to fetch datastore value from.

Returns:
  Datastore representation of the model value in a form that is
  appropriate for storing in the datastore.

Overrides: google.appengine.ext.db.Property.get_value_for_datastore
(inherited documentation)

make_value_from_datastore(self, value)

source code 
Native representation of this property.

Given a value retrieved from a datastore entity, return a value,
possibly converted, to be stored on the model instance.  Usually
this returns the value unchanged, but a property class may
override this when it uses a different datatype on the model
instance than on the entity.

This API is not quite symmetric with get_value_for_datastore(),
because the model instance on which to store the converted value
may not exist yet -- we may be collecting values to be passed to a
model constructor.

Args:
  value: value retrieved from the datastore entity.

Returns:
  The value converted for use as a model instance attribute.

Overrides: google.appengine.ext.db.Property.make_value_from_datastore
(inherited documentation)

validate(self, value)

source code 
Assert that provided value is compatible with this property.

Args:
  value: Value to validate against this Property.

Returns:
  A valid value, either the input unchanged or adapted to the
  required type.

Raises:
  BadValueError if the value is not appropriate for this
  property in any way.

Overrides: google.appengine.ext.db.Property.validate
(inherited documentation)