Exemplo n.º 1
0
 def _make_translations_for_properties(self, ModelPrimeType):
     model_properties_to_translation = {}
     for prop in heuristics.properties(ModelPrimeType):
         if prop not in self.keys_to_schema:
             model_properties_to_translation[prop] = translations.identity
     return model_properties_to_translation
Exemplo n.º 2
0
 def _make_nested_dict(obj):
     properties = heuristics.properties(type(obj))
     p_to_v = mapper.Mapper._map_properties_to_values(properties, obj)
     nested_dict = DictMapper._make_dict(p_to_v)
     return nested_dict
Exemplo n.º 3
0
def make_projection(ValueType, seperator='_'):
    value_properties = heuristics.properties(ValueType)
    translation = lambda p_to_v: _get_projection_args_from_model_properties(
        p_to_v, value_properties, seperator)
    return translation
Exemplo n.º 4
0
 def __init__(self, ModelType):
     self.ModelType = ModelType
     model_properties_to_translation = {
         heuristics.properties(ModelType):self._make_dict}
     super(DictMapper, self).__init__(dict, model_properties_to_translation)