How do I delete in Django? (mysql transactions)
Posted
by alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2010-05-08T21:55:50Z
Indexed on
2010/05/08
21:58 UTC
Read the original article
Hit count: 185
If you are familiar with Django, you know that they have a Authentication system with User model
. Of course, I have many other tables that have a Foreign Key to this User
model.
If I want to delete this user, how do I architect a script (or through mysql itself) to delete every table that is related to this user?
My only worry is that I can do this manually...but if I add a table , but I forget to add that table to my DELETE operation...then I have a row that links to a deleted, non-existing User.
© Stack Overflow or respective owner