Skip to content

Glossary: Django Basics

on_delete

Also written: PROTECT, CASCADE, models.PROTECT, models.CASCADE

A `ForeignKey` option that says what happens when the linked row is deleted. `PROTECT` refuses the deletion, while `CASCADE` deletes the related rows too.

Where the book teaches it

Related terms

ForeignKeyrelated_name