diff options
Diffstat (limited to 'bak/unused_apps/src/admin.py')
-rw-r--r-- | bak/unused_apps/src/admin.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/bak/unused_apps/src/admin.py b/bak/unused_apps/src/admin.py new file mode 100644 index 0000000..f354b15 --- /dev/null +++ b/bak/unused_apps/src/admin.py @@ -0,0 +1,62 @@ +from django.contrib import admin +from .models import Topic, SrcPost, Book +from utils.widgets import LGEntryForm + + +@admin.register(Topic) +class TopicAdmin(admin.ModelAdmin): + prepopulated_fields = {"slug": ('name',), "pluralized_name": ('name',)} + + +@admin.register(Book) +class BookAdmin(admin.ModelAdmin): + prepopulated_fields = {"slug": ('title', )} + list_display = ('title', 'pub_date', 'status') + fieldsets = ( + ('Entry', { + 'fields': ( + 'title', + 'body_markdown', + 'image', + ('pub_date', 'status'), + ('price', 'price_sale'), + 'meta_description', + ('slug', 'template_name', 'pages'), + ), + 'classes': ( + 'show', + 'extrapretty', + 'wide' + ) + } + ), + ) + + +@admin.register(SrcPost) +class PostAdmin(admin.ModelAdmin): + form = LGEntryForm + list_display = ('title', 'pub_date', 'enable_comments', 'status') + list_filter = ('pub_date', 'enable_comments', 'status') + prepopulated_fields = {"slug": ('title',)} + fieldsets = ( + ('Entry', { + 'fields': ( + 'title', + 'body_markdown', + ('pub_date', 'status'), + 'topics', + 'meta_description', + ('slug', 'enable_comments', 'has_code', 'template_name'), + ), + 'classes': ( + 'show', + 'extrapretty', + 'wide' + ) + } + ), + ) + + class Media: + js = ('image-loader.js', 'next-prev-links.js') |