Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能给这个类一个显示在后端而不是“EditedAddress”的标签?
class EditedAddressAdmin(admin.ModelAdmin): list_display = ('comp_name','fam_name', 'fon') search_fields = ['fam_name','comp_name'] admin.site.register(EditedAddress,EditedAddressAdmin)
您可以通过向模型添加 verbose_name 和/或 verbose_name_plural 来调整模型名称的显示方式:
class EditedAddress(models.Model): class Meta: verbose_name = 'Edited Address' verbose_name_plural = 'Edited Addresses'