Django “xxxxxx Object” display customization in admin action sidebar

前端 未结 9 1084
野的像风
野的像风 2020-12-02 10:07

I would like to change the default behavior of how the admin recent changes sidebar displays the name of \"objects\" added. Refer to the picture below:

9条回答
  •  余生分开走
    2020-12-02 10:50

    You're right in thinking that __unicode__ does that. I have this running right now:

    class Film(models.Model):
        title = models.CharField(max_length=200)
        ...
        def __unicode__(self):
            return self.title
    

    When I look in the recent actions list, I see the title of the film that I have just edited.

提交回复
热议问题