diff options
author | luxagraf <sng@luxagraf.net> | 2023-07-14 15:04:26 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-07-14 15:04:26 -0500 |
commit | 33a87ab2b62d4692c9e0450bccf203eafdd8cd80 (patch) | |
tree | a7933e366c2a70691c34210a10cccd81e3c77569 /app/products/admin.py | |
parent | 9dc6e678a57203f0bc5c08f4780069b7cabdb45a (diff) |
posts: added notes for saving urls
Diffstat (limited to 'app/products/admin.py')
-rw-r--r-- | app/products/admin.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/products/admin.py b/app/products/admin.py new file mode 100644 index 0000000..a25b84e --- /dev/null +++ b/app/products/admin.py @@ -0,0 +1,28 @@ +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',) |