姜戈 |如何让应用中的对象在查看列表时取name的值
DJANGO | How to make the object in the application take the value of the name when viewing the list
https://i.stack.imgur.com/30M2y.jpg - 图像管理面板
管理员代码:
from django.contrib import admin
from .models import Destination
admin.site.register(Destination)
夏天:
我做了动态迁移到主页。我希望目的地的名称在管理面板的列表中被接受。
怎么做?
我解决了问题:
from django.contrib import admin
from .models import Destination
class DestinationAdmin(admin.ModelAdmin):
list_display = ('name',) #I taking value from list of object.
admin.site.register(Destination, DestinationAdmin)
Nekain helped me
https://i.stack.imgur.com/30M2y.jpg - 图像管理面板
管理员代码:
from django.contrib import admin
from .models import Destination
admin.site.register(Destination)
夏天: 我做了动态迁移到主页。我希望目的地的名称在管理面板的列表中被接受。 怎么做?
我解决了问题:
from django.contrib import admin
from .models import Destination
class DestinationAdmin(admin.ModelAdmin):
list_display = ('name',) #I taking value from list of object.
admin.site.register(Destination, DestinationAdmin)
Nekain helped me