Is there a way to set ForeignKey attribute value knowing just the name of the attribute and the ID of the ForeignKey related object?
I tried to do this using setattr():
setattr(instance, 'product', 41)
The result is:
Cannot assign "41": "MyModel.product" must be a "Product" instance.