(self, field, val, overwrite=True)
Set using dot notation
Set using dot notation
Set using dot notation
def set(self, field, val, overwrite=True):
        """Set using dot notation"""
        nested_keys = field.split('.')
        tmp = self.data
        for i, key in enumerate(nested_keys):
            if key not in tmp:
                tmp[key] = {}
            if i == len(nested_keys) - 1:
                if (key in tmp and not overwrite):
                    return
                tmp[key] = val
            tmp = tmp[key]
def set ( self , field , val , overwrite = True ) : nested_keys = field . split ( '.' ) tmp = self . data for i , key in enumerate ( nested_keys ) : if key not in tmp : tmp [ key ] = { } if i == len ( nested_keys ) - 1 : if ( key in tmp and not overwrite ) : return tmp [ key ] = val tmp = tmp [ key ]