Use model_to_dict instead of x.__dict__.copy()