What does the save() method do in Django models?
Correct answer
C. Inserts a new object into the database
15 views
C. Inserts a new object into the database
15 views
save() writes the object to the database: for a new instance it inserts a new row.
If the object already has a primary key that exists in the table, the same method performs an UPDATE instead — Django decides automatically. Model.objects.create() builds and saves in one step.
Keep preparing with more Computer Science MCQs on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.