A

Admin • 833.24K Points
Coach

Q. What does the `on_delete=models.CASCADE` option do?

  • (A) Prevents deletion of related object
  • (B) Deletes related object
  • (C) Deletes current object if related is deleted
  • (D) Ignores delete
  • Correct Answer - Option(C)
  • Views: 23
  • Filed under category Django
  • Hashtags:

Explanation by: Admin

`CASCADE` deletes the dependent model when the related model is deleted.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.