[Answered ]-Django generic foreign key field not assigned during construction, but is able to be assigned post-construction

2👍

You haven’t saved d (or any of the items, for that matter), so it has no id which can be used in the object_id field of the generic relation. Save it first before allocating it to a.

Leave a comment