Skip to content

Instantly share code, notes, and snippets.

@KabakiAntony
Created October 29, 2022 17:27
Show Gist options
  • Save KabakiAntony/1932b8c6181a416f7062f8daaa66d13b to your computer and use it in GitHub Desktop.
Save KabakiAntony/1932b8c6181a416f7062f8daaa66d13b to your computer and use it in GitHub Desktop.
custom productadmin class
class ProductAdmin(admin.ModelAdmin):
# define how the custom form is going to be rendered
list_display = ['name','description','category','price', 'stock', 'available', 'date']
# also make a change to this registration line
# by adding ProductAdmin to the register method
tonyonline_admin_site.register(Product, ProductAdmin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment