From c23bbd34b4f31002c47ef6167144f104b74b5b71 Mon Sep 17 00:00:00 2001 From: pnshiralkar Date: Thu, 14 May 2020 16:26:01 +0530 Subject: Improved Adminsite view, changed CDN to static files --- cms/admin.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'cms/admin.py') diff --git a/cms/admin.py b/cms/admin.py index 8918797..595793e 100644 --- a/cms/admin.py +++ b/cms/admin.py @@ -1,9 +1,30 @@ from django.contrib import admin + from cms.models import * + # Register your models here. -admin.site.register(Nav) -admin.site.register(SubNav) -admin.site.register(Page) -admin.site.register(StaticFile) +class NavAdmin(admin.ModelAdmin): + list_display = ['name', 'link', 'position'] + ordering = ['position'] + + +class SubNavAdmin(admin.ModelAdmin): + list_display = ['name', 'nav', 'link', 'position'] + ordering = ['nav', 'position'] + list_filter = ['nav'] + + +class PageAdmin(admin.ModelAdmin): + list_display = ['title', 'permalink', 'pub_date'] + + +class StaticFileAdmin(admin.ModelAdmin): + list_display = ['filename', 'file'] + + +admin.site.register(Nav, NavAdmin) +admin.site.register(SubNav, SubNavAdmin) +admin.site.register(Page, PageAdmin) +admin.site.register(StaticFile, StaticFileAdmin) -- cgit