change db python code