Advertisement
object_254

add inlines to admin panel

Jan 18th, 2022
1,272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement