coding utf-8 from tinymce widgets import TinyMCE from django contrib i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8
from tinymce.widgets import TinyMCE
from django.contrib import admin
from django import forms
from infopage.models import InfoPage
class InfoPageForm(forms.ModelForm):
class Meta:
model = InfoPage
class Media:
js = ('js/jquery.js', 'js/admin_infopage.js')
def __init__(self, *args, **kwargs):
super(InfoPageForm, self).__init__(*args, **kwargs)
self.fields['content'].widget = TinyMCE(mce_attrs={'language': 'en'},
content_language='en')
class InfoPageAdmin(admin.ModelAdmin):
form = InfoPageForm
list_display = ['title', 'country', 'index', 'slug', 'address']
list_filter = ['index', 'country']
admin.site.register(InfoPage, InfoPageAdmin)