Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
Handling delete of foreignkey
20 views
Skip to first unread message
Jonty Needham
unread,
Dec 23, 2015, 11:58:16 AM
12/23/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
12/23/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
The, um, link in my question answers my question.
Reply all
Reply to author
Forward
0 new messages