所以我在admin.py中有这样的东西
from .models import Venue
class VenueAdmin(admin.ModelAdmin):
list_display = ["country", "zip", "city", "name", "street"]
admin.site.register(Venue, VenueAdmin)
当我在django管理员中时,我只能点击“land”值来编辑场地。是否可以使“名称”也可以点击?
提前致谢,请记住,如果答案太明显,我是新手。
答案 0 :(得分:1)
您需要定义list_display_links
:
class VenueAdmin(admin.ModelAdmin):
list_display = ["country", "zip", "city", "name", "street"]
list_display_links = ['name', 'country']