I have a model:
class Review(models.Model):
name = models.CharField(max_lengt开发者_运维问答h = 50)
link = models.CharField(max_length = 100)
book_id = models.IntegerField()
review_id = models.IntegerField()
content = models.TextField()
rating = models.IntegerField()
author = models.CharField(max_length = 50)
If I open admin http://127.0.0.1:8000/admin/my_app/review/ I'll see the list of records. For each record Django Admin display only one field ('Name' in my case). How Django Admin choise the field to display in the list of records.
Firstly I thinked that it is a first field in my model. I have moved Name-field down in the field list and recreate the database, but there was nothing to change.
Django calls the __unicode__
method on the model. For configuring the displayed fields in the change list see the detailed documentation!
精彩评论