I have a Task class (models.Model), and I did not explicitly define the id field (since it automatically detects you). I checked in the database, it exists for the task. Now I would like to display it in the list via the list_display property in admin.ModelAdmin. I have a bunch of things, only the identifier is not displayed for any of the lines that I have. Everything else works fine. Does anyone know anything special that I need to do to display id?
EDIT: if I define a function as follows:
def ID(self, obj): return obj.id
and I put this function in list_display, for some reason the identifier will be displayed.
Thanks a lot!
Jason
source share