Displaying Table Using Models In Django Admin
I am trying to create a project management kind of app. Now I have the project model like in this image When i save it, i can able to get username and time. Now. In the same page
Solution 1:
You may want either AdminInline
or list_editable
Django features:
If you have linked models, say a
Project
and aProduct
, which is linked toProject
, you can make your product editable as inlines:classProductInline(admin.TabularInline): model =Product classProject(admin.ModelAdmin): model = Project inlines = [ProductInline, ]
If you have a standalone table, say,
Product
, you can make its list to be editable:classProductAdmin(admin.ModelAdmin): model = Productlist_display= ['quantity', 'description', 'tax_rate', ] list_editable = ['quantity', 'description', 'tax_rate', ]
Post a Comment for "Displaying Table Using Models In Django Admin"