What does the delete() method do in Django models?
Correct answer
B. Deletes the object from the database
19 views
B. Deletes the object from the database
19 views
delete() removes the object from the database. It can be called on one instance or on a whole queryset, and returns the number of objects deleted.
Related objects are handled according to each ForeignKey's on_delete rule, for example CASCADE.
Want more practice? Try the full set of Computer Science MCQs on MCQsExam.com.
Not sure why the answer is B? Ask here and get an explanation.