Relative Content

Tag Archive for djangodjango-rest-framework

Creating foreign fields in Django right after the object creation

I am getting a JSON input with the fields description and choices for a Question model. The Choice model also has a foreign key field pointing to Question with a related name of choices. However, in the JSON, the Choice will come without the question_id field, in order to be assigned after the creation of the Question