OK. So it's by design. So during development I can't go straight to the database and delete a "Group" quickly due to an error I made. I'd have to set up tests to deal with it at an application level.
No probs though. I'm just happy I know it can't be done and not that it's a bug I'd have to wait for. Thanks for the answers :) On Saturday, 23 June 2018 14:16:33 UTC+1, Melvyn Sopacua wrote: > > On zaterdag 23 juni 2018 14:40:30 CEST Jason wrote: > > Not quite. If you run python manage.py sqlmigrate <appname> > > <migration_name>, you can see the SQL generated for that migration. > > > > > https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigr > > ate > > > > Because Django emulates Cascade, its done outside of the db, and > therefore > > shouldn't be a db-level constraint. > > The case for and against can be made pretty much with the same argument: > - for: if a row is deleted outside of Django, so by direct database > manipulation, then the relations become inconsistent, so having database > reflect models prevents this. > - against: if a row is deleted outside of Django, so by direct database > manipulation, then signals are not processed and objects are deleted > regardless. The consequences of this are unpredictable and application > specific. > > Django chose to not align model relations with database representation. > Knowing this means you have to handle things through Django exclusively > where > it matters. > > -- > Melvyn Sopacua > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3d0c543f-3be6-4c24-92a4-18f19182441d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.