Open GoogleCodeExporter opened 9 years ago
I'm using appengine patch with django 1.1 (came with appengine patch) on ubunto 9.04 I am trying to use CKEditor 3.0.1 in the admin. I have downloaded en extracted ckeditor into the media folder and added formfield_overrides in my admin.py. I even did a did generatemadia but see no change in the admin. How should i correctly install ckeditor? I have placed ckeditor folder in media folder as follows: -media - js - ckeditor - ... - ckeditor.js - ... In pages/models.py: ------------------- class Page(db.Model): """Page model.""" title = db.StringProperty(_('title')) author = db.ReferenceProperty(User) status = db.StringProperty(_('status'), choices=[_('draft'), _('public'), _('hidden'), ]) created = db.DateTimeProperty(_('created')) modified = db.DateTimeProperty(_('modified')) non_indexable = db.BooleanProperty(_('hide from index')) def __unicode__(self): return '%s' % self.title @permalink def get_absolute_url(self): return ('pages_page_detail_view', [self.key()]) class File(db.Model): """File model.""" title = db.StringProperty(_('title')) data = db.BlobProperty() added = db.DateTimeProperty(_('added')) page = db.ReferenceProperty(Page) content_type = db.StringProperty(_('mimetype')) def __unicode__(self): return '%s' % self.get_absolute_url() @permalink def get_absolute_url(self): return ('pages_file_download_view', [self.key()]) class Column(db.Model): """Column model.""" title = db.StringProperty(_('title')) data = db.TextProperty(_('data')) page = db.ReferenceProperty(Page) def __unicode__(self): return '%s' % self.title @permalink def get_absolute_url(self): return ('pages_column_detail_view', [self.key()]) In pages/admin.py: ------------------ class FileInline(admin.TabularInline): model = File extra = 1 class ColumnInline(admin.TabularInline): model = Column extra = 1 max_num = 3 class PageAdmin(admin.ModelAdmin): #/pages/ list_display = ('title', 'created', 'modified',) list_filter = ('modified',) search_fields = ('title', 'column__data') #/pages/page/ fieldsets = ( (_('Content'), { 'fields': ('title', 'author', 'status') }), (_('Meta'), { 'fields': ('non_indexable', 'created', 'modified') }), ) #/pages/column/ en /pages/file/ inlines = [ ColumnInline, FileInline, ] #CKEditor formfield_overrides = { db.TextProperty: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, } class Media: js = ('js/ckeditor/ckeditor.js',) admin.site.register(Page, PageAdmin) class FileAdmin(admin.ModelAdmin): list_display = ('title', 'added',) list_filter = ('added',) search_fields = ('title',) admin.site.register(File, FileAdmin) class ColumnAdmin(admin.ModelAdmin): list_display = ('title',) search_fields = ('title', 'data') admin.site.register(Column, ColumnAdmin) In app.yaml: ------------ application: aep-sample version: 1 runtime: python api_version: 1 default_expiration: '3650d' handlers: - url: /remote_api script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py secure: optional login: admin - url: /media static_dir: _generated_media secure: optional - url: /.* script: common/appenginepatch/main.py secure: optional
Original issue reported on code.google.com by dstrijdh...@gmail.com on 5 Nov 2009 at 3:38
dstrijdh...@gmail.com
Original issue reported on code.google.com by
dstrijdh...@gmail.com
on 5 Nov 2009 at 3:38