Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set numbers of admin.TabularInline in django admin

how can I set numbers of admin.Tabularline in django admin? in default, it shows 3 empty rows and i just want to show only 1 empty row.

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)
like image 905
gadss Avatar asked Mar 05 '12 06:03

gadss


1 Answers

Set your inline's extra attribute to 1.

like image 64
Thomas Orozco Avatar answered Oct 06 '22 18:10

Thomas Orozco