summaryrefslogtreecommitdiff
path: root/bak/unused_apps/products/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'bak/unused_apps/products/admin.py')
-rw-r--r--bak/unused_apps/products/admin.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/bak/unused_apps/products/admin.py b/bak/unused_apps/products/admin.py
new file mode 100644
index 0000000..3a26358
--- /dev/null
+++ b/bak/unused_apps/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', 'pub_date')
+ search_fields = ['name', 'body_markdown']
+ list_filter = ('rating', 'pub_date')
+
+ 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 = ('pub_date',)
+
+ class Media:
+ js = ('next-prev-links.js',)