djangosnippets.org: Latest snippets posted by psagershttps://djangosnippets.org/users/psagers/2008-12-02T22:47:48.720492-06:00psagersClear nullable foreign keys on delete
2008-12-02T22:47:48.720492-06:00psagershttps://djangosnippets.org/snippets/1231/<p>Django 1.0 is apparently hard-coded for cascading deletes. I find that I often have nullable foreign keys on models whose records must not be deleted along with those they refer to. I override Model.delete() in an intermediate base class and execute this method to clear out all nullable foreign keys …</p>
Freely redistributable