summaryrefslogtreecommitdiff
path: root/app/classes/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/classes/admin.py')
-rw-r--r--app/classes/admin.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/classes/admin.py b/app/classes/admin.py
new file mode 100644
index 0000000..5fcca4b
--- /dev/null
+++ b/app/classes/admin.py
@@ -0,0 +1,45 @@
+from django.contrib import admin
+from django import forms
+from django.contrib.gis.admin import OSMGeoAdmin
+from django.contrib.contenttypes.admin import GenericStackedInline
+
+from utils.widgets import AdminImageWidget, LGEntryForm
+from .models import Class, Session, ClassMedia
+
+
+@admin.register(Class)
+class ClassAdmin(admin.ModelAdmin):
+ list_display = ('title', 'session')
+ search_fields = ['title', 'description']
+ prepopulated_fields = {"slug": ('title',)}
+ list_filter = ('session',)
+ filter_horizontal = ('uploads',)
+
+ class Media:
+ js = ('image-loader.js', 'product-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }
+
+
+@admin.register(Session)
+class SessionAdmin(admin.ModelAdmin):
+ list_display = ('title','date_start','date_end' )
+ prepopulated_fields = {"slug": ('title',)}
+
+ class Media:
+ js = ('image-loader.js', 'product-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }
+
+
+@admin.register(ClassMedia)
+class ClassMediaAdmin(admin.ModelAdmin):
+ list_display = ('title','file' )
+
+ class Media:
+ js = ('image-loader.js', 'product-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }