更新时间:2023-02-08 19:37:14
我尚未对此进行测试,但是从理论上讲,您可以这样做:
I haven't tested this, but in theory you could do:
class MyTemplateAdmin(admin.ModelAdmin):
def __init__(self, *args, **kwargs):
super(MyTemplateAdmin, self).__init__(*args, **kwargs)
#see if there are new templates
#and set the inlines list property
list_display = ('name')
search_fields = ['name']
希望对您有帮助.