Changes between Version 14 and Version 15 of AddWYSIWYGEditor


Ignore:
Timestamp:
02/01/2008 09:05:48 AM (7 years ago)
Author:
jbronn
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddWYSIWYGEditor

    v14 v15  
    7575'''With [wiki:NewformsAdminBranch newforms-admin]''', you have to use black magic, at the time of writing.
    7676
    77 If you look at [source:django/branches/newforms-admin/django/contrib/admin/options.py the AdminOptions class], you'll note that there's a {{{media}}} property, which generates a
    78 new {{{Media}}} object each time you access the attribute. To get by that, we need to remake this property and "inject" our own JavaScripts.
     77If you look at [source:django/branches/newforms-admin/django/contrib/admin/options.py the ModelAdmin class], you'll note that there's a {{{media}}} property, which generates a
     78new {{{Media}}} object each time you access the attribute. To get by that, we need to remake this property and "inject" our !JavaScript locations.
    7979
    8080{{{
    8181#!python
    82 class MyAdminOpts(admin.ModelOptions):
     82class MyAdminOpts(admin.ModelAdmin):
    8383     def _media(self):
    8484         media = super(MyAdminOpts, self)._media()
    8585         media.add_js([
    8686             "http://path/to/tiny_mce.js",
    87              "http://path/to/settings/"])
     87             "http://path/to/textarea.js"])
    8888         return media
    8989     media = property(_media)
Back to Top