From f8eced917dbd4d01d39a881a0ba948a575452a0d Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sun, 8 Jan 2012 14:33:12 +0100 Subject: add preview_admin --- sublab_project/news/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sublab_project/news') diff --git a/sublab_project/news/admin.py b/sublab_project/news/admin.py index ea422e4..1f89f25 100644 --- a/sublab_project/news/admin.py +++ b/sublab_project/news/admin.py @@ -1,14 +1,17 @@ from django.contrib import admin from sorl.thumbnail.admin import AdminImageMixin +from preview_admin import PreviewAdmin from news.models import News +from utils import render_creole -class NewsAdmin(AdminImageMixin, admin.ModelAdmin): +class NewsAdmin(AdminImageMixin, PreviewAdmin): prepopulated_fields = {'slug': ('title',)} list_display = ('title', 'date_created', 'date_updated') list_filter = ('author',) search_fields = ['title', 'content'] + preview_fields = { 'content': render_creole } date_hierarchy = 'date_updated' def save_model(self, request, obj, form, change): -- cgit v1.2.1