Admin application deltes related objects on "null=True" relation.
|Reported by:||x_O||Owned by:||nobody|
|Severity:||Keywords:||admin delete remove related null True|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
We have two models
class First(db.models): second_item = models.ForeignKey('Second',null=True) ... class (db.models): ...
Both models registered in admin.py as AdminModels.
Trying to delete object created from "Second" class
which is RELATED to other one created from "First" class, admin tells that will remove also that "First" object. Important is that relation in
ForeignKey is null.
My interpretation of that "null=True" for admin.contrib: should set First objects with 'second_item' attribute = None.
Checked against 1.1.