Changes between Version 20 and Version 21 of AddWYSIWYGEditor


Ignore:
Timestamp:
Jul 13, 2008, 7:08:07 AM (16 years ago)
Author:
Martin Diers <martin@…>
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddWYSIWYGEditor

    v20 v21  
    7373
    7474=== With newforms-admin ===
    75 Since changeset [7365] you can now add a media definition to a new ModelForm instance and assign it to your ModelAdmin instance.
     75Add a media definition to a your ModelAdmin instance:
    7676
    7777{{{
    7878#!python
    79 from django.newforms import ModelForm
    8079
    81 class TinyMCEPageForm(ModelForm)
     80class MyModelOptions(admin.ModelAdmin):
     81    form = TinyMCEPageForm
     82
    8283    class Media:
    8384        js = ('/js/tiny_mce/tiny_mce.js',
    8485              '/js/tiny_mce/textarea.js',)
    85 
    86 class MyModelOptions(admin.ModelAdmin):
    87     form = TinyMCEPageForm
    8886
    8987admin.site.register(MyModel, MyModelOptions)
     
    9189}}}
    9290
    93 For newforms-admin, /js paths '''will not''' be given a /media/ prefix. The above example requires a static path to /js, so adjust paths and locations accordingly.
     91MEDIA_URL will be prepended to the above urls, so adjust your paths accordingly.
    9492
    9593=== Using TinyMCE with flatpages ===
Back to Top