I just need a confirmation for my understanding on Django's implementation of ON DELETE CASCADE from you Django experts.
According to the official Django documentation:
When Django deletes an object, by default it emulates the behavior of the SQL constraint ON DELETE CASCADE -- in other words, any objects which had foreign keys pointing at the object to be deleted will be deleted along with it.
Does the word "emulate" imply that the ON DELETE CASCADE logic is actually implemented in Django instead of at the database level? (I looked into my database and all the tables that contains foreign keys have ON DELETE NO ACTION in their definitions.)
If my understanding is correct, is there any way that I can relocate the ON DELETE CASCADE logic from the app layer to the database layer? I am more looking for a proper way, not an hack, of doing this. (Note: I am using PostgreSQL as my backend.)