summaryrefslogtreecommitdiff
path: root/app/pages/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/pages/admin.py')
-rw-r--r--app/pages/admin.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/pages/admin.py b/app/pages/admin.py
index 66e4d8f..844007e 100644
--- a/app/pages/admin.py
+++ b/app/pages/admin.py
@@ -1,13 +1,22 @@
from django.contrib import admin
+from django import forms
from django.forms import Textarea
from django.db import models
-'''
+from pages.models import Page
+
+class PageEntryForm(forms.ModelForm):
+ class Meta:
+ model = Page
+ fields = '__all__'
+ widgets = {
+ 'body_markdown': forms.Textarea(attrs={'rows': 50, 'cols': 100}),
+ }
+
class PageAdmin(admin.ModelAdmin):
- formfield_overrides = {
- models.TextField: {'widget': Textarea(attrs={'rows': 25, 'cols': 40})},
- }
+ form = PageEntryForm
+
list_display = ('title', 'slug',)
search_fields = ['title', 'body_markdown']
prepopulated_fields = {"slug": ('title',)}
@@ -23,4 +32,3 @@ class PageAdmin(admin.ModelAdmin):
)
admin.site.register(Page, PageAdmin)
-'''