def __getstate__(self):
    state = self.__dict__.copy()
del state['_sa_instance_state']
return state

def __setstate__(self, state):
    self.__dict__.update(state)
How to exclude specific fields on serialization with jsonpickle?