Handling delete of foreignkey

20 views
Skip to first unread message

Jonty Needham

unread,
Dec 23, 2015, 11:58:16 AM12/23/15
to django...@googlegroups.com
So I have an object that contains a foreignkey to another object that will be deleted, that means that my object should get deleted.

Having read some of the docs on https://docs.djangoproject.com/en/1.7/ref/models/fields/#django.db.models.ForeignKey.on_delete (yes I know it's 1.7) I understand that if I added

on_delete=SET_NULL to my foreignkey, when it the foreignkeyed object was deleted my object would set my foreignkey to null. Is that correct?

Jonty

Jonty Needham

unread,
Dec 23, 2015, 12:45:46 PM12/23/15
to django...@googlegroups.com
The, um, link in my question answers my question.
Reply all
Reply to author
Forward
0 new messages