In this picture, only the title shows up on here, I used:
def __unicode__(self):
return self.title;
here is the each individual objects
How do I show all these fields?
How do I show all the fields in each Model page?
In this picture, only the title shows up on here, I used:
def __unicode__(self):
return self.title;
here is the each individual objects
How do I show all these fields?
How do I show all the fields in each Model page?
Show all fields:
If you want to include all but the ManyToManyField field names, and have them in the same order as in the models.py file, you can use:
As you can see, I also excluded the id.
If you find yourself doing this a lot, you could create a subclass of ModelAdmin:
and then just inherit from that:
or you can do it as a mixin:
The mixin is useful if you want to inherit from something other than admin.ModelAdmin.
Here is my approach, will work with any model class:
This will do two things:
Then to register you model:
Note: if you are using a different default model admin, replace 'admin.ModelAdmin' with your admin base class
Many of the answers are broken by Django 1.10. For version 1.10 or above, this should be
Docs
I like this answer and thought I'd post the complete admin.py code (in this case, I wanted all the User model fields to appear in admin)
I found OBu's answer here to be very useful for me. He mentions:
A small adjustment to his method solves this problem as well:
Worked for me.