from django.contrib import admin from uncloud_pay.models import Bill, Order, BillRecord, BillingAddress class BillRecordInline(admin.TabularInline): model = Bill.bill_records.through class BillAdmin(admin.ModelAdmin): inlines = [ BillRecordInline ] ; admin.site.register(Bill, BillAdmin) admin.site.register(Order) admin.site.register(BillRecord) admin.site.register(BillingAddress)