django-generic-confirmation icon indicating copy to clipboard operation
django-generic-confirmation copied to clipboard

Add on_delete on ForeignKeys for compatibility with Django >= 2 ?

Open alexAubin opened this issue 7 years ago • 3 comments

Hellow,

thank you for your work on this module

I was trying to use this with Django >= 2, and it was complaining that ForeignKeys don't have any on_delete attribute (which is now mandatory)

I've set it to SET_NULL, but honestly I have no idea if that's the right fix :s ...

alexAubin avatar Apr 20 '18 13:04 alexAubin

You are right, an update for Django 2 is needed!

I've looked into the docs and it seems to me that models.CASCADE might be the right strategy to use.

If a User object is deleted we can savely delete all pending actions for that User. And if a ContentType object is deleted we should also delete all pending actions regarding this ContentType.

Do you agree?

arneb avatar Apr 20 '18 16:04 arneb

Sure ! I'm still a bit of a noob with Django and the whole DB world, not mentionning that I just discovered this lib, so you know best ^^'

I can either apply the change or you can do it, as you see fit

alexAubin avatar Apr 20 '18 16:04 alexAubin

Why has not this PR been merged?

BoPeng avatar Mar 01 '20 03:03 BoPeng