18 lines
607 B
Python
18 lines
607 B
Python
from models import PadmaText
|
|
from django.contrib import admin
|
|
from django import forms
|
|
from django.db import models
|
|
|
|
#refer: http://johansdevblog.blogspot.com/2009/10/adding-ckeditor-to-django-admin.html
|
|
class PadmaTextAdmin(admin.ModelAdmin):
|
|
formfield_overrides = {models.TextField: {'widget':forms.Textarea(attrs={'class':'ckeditor'})}, }
|
|
prepopulated_fields = {'slug': ('title',)}
|
|
|
|
class Media:
|
|
js = ('ckeditor/ckeditor.js',) # The , at the end of this list IS important.
|
|
css = {
|
|
'all': ('/static/css/admin_textarea.css',)
|
|
}
|
|
|
|
admin.site.register(PadmaText,PadmaTextAdmin)
|