如何在admin.Tabularline
中设置django admin
的数量?默认情况下,它显示3个空行,我只想显示1个空行。
class ClientPaymentOptionInline(admin.TabularInline):
model = ClientPaymentOption
fields = ('name', 'action','percent', 'fixamount', 'itemcharged', 'client')
class ClientAdmin(admin.ModelAdmin):
#display list
list_display = ('name','b_type','banner','logo',
'contact','address','account_type',
'status','currency','color','user',
)
#display fields
fields = ('name','b_type','banner','logo','contact',
'address','account_type','status',
'currency','color','user',
)
inlines = [ClientPaymentOptionInline]
admin.site.register(Client, ClientAdmin)
答案 0 :(得分:9)
将内联的extra
属性设置为1。