labpack/databases/google/datastore.py
def _reconstruct_record(self, entity):

        ''' a helper method for reconstructing a record from a datastore entity '''

        details = {
            'id': entity.key._flat_path[-1]
        }
        current = details
        for key, value in self.model.keyMap.items():
            record_key = key[1:]
            if record_key:
                record_value = entity.get(record_key, None)
                if record_value != None:
                    record_segments = record_key.split('.')
                    for i in range(len(record_segments)):
                        segment = record_segments[i]
                        if i + 1 < len(record_segments):
                            if segment not in details.keys():
                                current[segment] = {}
                            current = current[segment]
                        else:
                            if value['value_datatype'] == 'list' and record_key in self.json_lists:
                                current[segment] = json.loads(record_value)
                            elif value['value_datatype'] == 'map':
                                current[segment] = json.loads(record_value)
                            else:
                                current[segment] = record_value
                    current = details

        return details
 a helper method for reconstructing a record from a datastore entity 
a helper method for reconstructing a record from a datastore entity
a helper method for reconstructing a record from a datastore entity
def _reconstruct_record(self, entity):
        details = {
            'id': entity.key._flat_path[-1]
        }
        current = details
        for key, value in self.model.keyMap.items():
            record_key = key[1:]
            if record_key:
                record_value = entity.get(record_key, None)
                if record_value != None:
                    record_segments = record_key.split('.')
                    for i in range(len(record_segments)):
                        segment = record_segments[i]
                        if i + 1 < len(record_segments):
                            if segment not in details.keys():
                                current[segment] = {}
                            current = current[segment]
                        else:
                            if value['value_datatype'] == 'list' and record_key in self.json_lists:
                                current[segment] = json.loads(record_value)
                            elif value['value_datatype'] == 'map':
                                current[segment] = json.loads(record_value)
                            else:
                                current[segment] = record_value
                    current = details
        return details
def _reconstruct_record ( self , entity ) : details = { 'id' : entity . key . _flat_path [ - 1 ] } current = details for key , value in self . model . keyMap . items ( ) : record_key = key [ 1 : ] if record_key : record_value = entity . get ( record_key , None ) if record_value != None : record_segments = record_key . split ( '.' ) for i in range ( len ( record_segments ) ) : segment = record_segments [ i ] if i + 1 < len ( record_segments ) : if segment not in details . keys ( ) : current [ segment ] = { } current = current [ segment ] else : if value [ 'value_datatype' ] == 'list' and record_key in self . json_lists : current [ segment ] = json . loads ( record_value ) elif value [ 'value_datatype' ] == 'map' : current [ segment ] = json . loads ( record_value ) else : current [ segment ] = record_value current = details return details
a helper method for reconstructing a record from a datastore entity
a helper method for reconstructing a record from a datastore entity
''' a helper method for reconstructing a record from a datastore entity '''
self
entity