0

Various other posts on stack have looked at how to "properly" include a foreignkey in list_display, which enables sorting, etc.

However, I am not interested in that. I just want to display the unicode of the foreignkey field.

From the django docs:

A few special cases to note about list_display:

If the field is a ForeignKey, Django will display the __unicode__() of the related object.

I had this working previously, but since I last checked the django admin, it is no longer displaying any entries at all if the list_display includes a foreignkey field. Once the foreignkey field is removed from list_display, the entries are once again displaying.

I obviously updated something minor that caused this. Any ideas?

snakesNbronies
  • 3,619
  • 9
  • 44
  • 73

1 Answers1

0

Found out that this may be due to a DB issue storing the foreignkey info as an empty string.

As I am still in development, I simply dropped the table. However, I welcome discussion and answers on how to fix this without dropping the table.

Django admin List Display + ForeignKey = Empty Change List

Community
  • 1
  • 1
snakesNbronies
  • 3,619
  • 9
  • 44
  • 73