id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 18682,Make the deletion of stale content types safer,Aymeric Augustin,Florian Apolloner ,"When a model is removed, `syncdb` offers to remove its content type : {{{ The following content types are stale and need to be deleted: myapp | mymodel Any objects related to these content types by a foreign key will also be deleted. Are you sure you want to delete these content types? If you're unsure, answer 'no'. Type 'yes' to continue, or 'no' to cancel: }}} While perfectly clear, this text is quite unhelpful, because there's no easy way to determine if any instance still has a foreign key to the content type. To mitigate the risk of accidental cascade deletions -- sometimes you can be sure and wrong -- Django could tell the user how many related objects will be deleted, if any. This is similar to the admin's cascade delete UI, but only one level deep. It would be quite embarrassing to admit why I'm filing this ticket. Let's just say the problem that shows up in the real world. Until we do something about this, I'll add `on_delete=models.PROTECT` to all my foreign key to `ContentType` in `GenericForeignKey` definitions. ",Cleanup/optimization,closed,contrib.contenttypes,1.3,Normal,fixed,,charette.s@… speijnik,Accepted,1,0,0,0,0,0