19
如何更改in_stock verbose_name?如何更改Django Admin自定義列表字段標籤
Models.py
class Book(models.Model): name = models.CharField(u"Нэр", max_length = 200) @property def in_stock(self): return self.stocks.count()
林Admin.py
class BookAdmin(admin.ModelAdmin): list_display = ('name', 'in_stock') search_fields = ('name',)