Objects not being displayed in Django Admin when Foreign key is Null

280 views Asked by At

I have a Model "Item" that has a field "req_item", that's a nullable foreign key. Everything seems to working fine, but when the "req_item" field is null, the object is not displayed in django admin altogether. Here's the image for reference: enter image description here

All the "req_item" filed values are null in DB at the moment, so none of the objects are displayed. If I assign a valid req_item value to an object in the DB, then only that object is displayed. How can I fix this issue. Here's my admin.py

0

There are 0 answers