App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.ext.bulkload.bulkloader_config.DictConvertor Class Reference
Inheritance diagram for google.appengine.ext.bulkload.bulkloader_config.DictConvertor:

Public Member Functions

def __init__
 
def dict_to_entity
 
def entity_to_dict
 

Detailed Description

Convert a dict to an App Engine model instance or entity. And back.

The constructor takes a transformer spec representing a single transformer
in a bulkloader.yaml.

The DictConvertor object has two public methods, dict_to_entity and
entity_to_dict, which do the conversion between a neutral dictionary (the
input/output of a connector) and an entity based on the spec.

Note that the model class may be used instead of an entity during the
transform--this adds extra validation, etc, but also has a performance hit.

Constructor & Destructor Documentation

def google.appengine.ext.bulkload.bulkloader_config.DictConvertor.__init__ (   self,
  transformer_spec 
)
Constructor. See class docstring for more info.

Args:
  transformer_spec: A single transformer from a parsed bulkloader.yaml.
This assumes that the transformer_spec is valid. It does not
double check things like use_model_on_export requiring model.

Member Function Documentation

def google.appengine.ext.bulkload.bulkloader_config.DictConvertor.dict_to_entity (   self,
  input_dict,
  bulkload_state 
)
Transform the dict to a model or entity instance(s).

Args:
  input_dict: Neutral input dictionary describing a single input record.
  bulkload_state: bulkload_state object describing the state.

Returns:
  Entity or model instance, or collection of entity or model instances,
  to be uploaded.
def google.appengine.ext.bulkload.bulkloader_config.DictConvertor.entity_to_dict (   self,
  entity,
  bulkload_state 
)
Transform the entity to a dict, possibly via a model.

Args:
  entity: An entity.
  bulkload_state: bulkload_state object describing the global state.

Returns:
  A neutral output dictionary describing the record to write to the
  output.
  In the future this may return zero or multiple output dictionaries.

The documentation for this class was generated from the following file: