admin list_display with broken foreignkey fails
|Reported by:||Dan Ros||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
You have a model which includes a ForeignKey field. In one of the instances of that model, that ForeignKey points to something which has disappeared for whatever reason.
If you view the object in the admin, it correctly displays that ForeignKey mapping as '----' ie null.
If you include that ForeignKey field in list_display in admin.py, django attempts to look up that relation, fails, and throws a record not found exception.
I realise that this is fundamentally a problem with referential integrity of the database - the question is, is django's handling of that a bug?