from django.contrib import admin from .models import Brand, Product from utils.widgets import AdminImageWidget, LGEntryForm @admin.register(Product) class ProductAdmin(admin.ModelAdmin): form = LGEntryForm list_display = ('name', 'admin_thumbnail', 'rating', 'date_created') search_fields = ['name', 'body_markdown'] list_filter = ('rating', 'date_created') class Media: js = ('image-loader.js', 'next-prev-links.js') css = { "all": ("my_styles.css",) } @admin.register(Brand) class BrandAdmin(admin.ModelAdmin): list_display = ('name', ) search_fields = ['name',] list_filter = ('date_created',) class Media: js = ('next-prev-links.js',)