1👍
✅
You can’t set a ForeignKey
object as int
. You can instead set the ForeignKey
value (id associated with the FK object) by appending _id
to the field:
fixtureUpdate = StraightredFixture(fixtureid=fixture['Id'],
...
soccerseason_id = 1025)
# ^^^
0👍
Try to replace soccerseason = 1025
with soccerseason_id = 1025
. soccerseason
is a relationship to StraightredSeason
so you should provide an instance of it when trying to set this attribute.
- Gunicorn giving syntax error for my configuration file
- Display items in a database in a webpage and edit
- AngularJS Logging Out and Logging back in
- How to pass a extra parameter using perform_create of django rest framwork?
Source:stackexchange.com