Advertisement
object_254

add inlines to admin panel

Jan 18th, 2022
962
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class TransactionTabular(admin.TabularInline):
  2.     extra = 0
  3.     show_change_link = True
  4.     model = Transaction
  5.     exclude = ('created_at', 'updated_at', 'created_by', 'updated_by',)
  6.  
  7. @admin.register(Invoice)
  8. class InvoiceAdmin(admin.ModelAdmin):
  9.     list_display = ('id', 'amount', 'is_paid', 'booking', 'updated_at', 'rk_uid')
  10.     inlines = [
  11.         TransactionTabular
  12.     ]
  13.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement