diff options
Diffstat (limited to 'app/pages/admin.py')
-rw-r--r-- | app/pages/admin.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/pages/admin.py b/app/pages/admin.py new file mode 100644 index 0000000..e1328e9 --- /dev/null +++ b/app/pages/admin.py @@ -0,0 +1,26 @@ +from django.contrib import admin +from django import forms +from pages.models import Page +from django.conf import settings + +from django.forms import TextInput, Textarea +from django.db import models +class PageAdmin(admin.ModelAdmin): + formfield_overrides = { + models.TextField: {'widget': Textarea(attrs={'rows':25, 'cols':40})}, + } + list_display = ('title', 'slug',) + search_fields = ['title', 'body_markdown'] + prepopulated_fields = {"slug" : ('title',)} + fieldsets = ( + ('Page', { + 'fields': ('title','body_markdown', 'slug'), + 'classes': ('show','extrapretty','wide') + }), + ('Metadata', { + 'classes': ('collapse closed',), + 'fields': ('meta_description',), + }) + ) + +admin.site.register(Page, PageAdmin) |