1👍
As you can see in your Offer
model you have a field called currency_to_sell
, it contains an object of the Currency
model so when you are sending an id in your POST
request you’re getting the following error:
Cannot assign "115": "Offer.currency_to_sell" must be a "Currency" instance.
Therefore you have two options:
- When you generate the form, add a hidden field that also includes the content type id as explained in this answer https://stackoverflow.com/a/32110462/14535309
- Change your
Offer
model in a way that thecurrency_to_sell
is actually just an id of aCurrency
and then use that in your views to query the db for the requiredCurrency
object.
Source:stackexchange.com