diff options
author | lxf <sng@luxagraf.net> | 2022-05-14 16:38:07 -0400 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2022-05-14 16:38:07 -0400 |
commit | bb3973ffb714c932e9ec6dd6a751228dc71fe1d3 (patch) | |
tree | 6fa32f9392ad2ec32271349b86a4c1388fd6ba95 /app/classes/admin.py |
initial commit
Diffstat (limited to 'app/classes/admin.py')
-rw-r--r-- | app/classes/admin.py | 45 |
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",) + } |