summaryrefslogtreecommitdiff
path: root/sublab_project/news
diff options
context:
space:
mode:
Diffstat (limited to 'sublab_project/news')
-rw-r--r--sublab_project/news/admin.py5
1 files changed, 4 insertions, 1 deletions
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):