Changes between Version 20 and Version 21 of AddWYSIWYGEditor
- Timestamp:
- Jul 13, 2008, 7:08:07 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddWYSIWYGEditor
v20 v21 73 73 74 74 === 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. 75 Add a media definition to a your ModelAdmin instance: 76 76 77 77 {{{ 78 78 #!python 79 from django.newforms import ModelForm80 79 81 class TinyMCEPageForm(ModelForm) 80 class MyModelOptions(admin.ModelAdmin): 81 form = TinyMCEPageForm 82 82 83 class Media: 83 84 js = ('/js/tiny_mce/tiny_mce.js', 84 85 '/js/tiny_mce/textarea.js',) 85 86 class MyModelOptions(admin.ModelAdmin):87 form = TinyMCEPageForm88 86 89 87 admin.site.register(MyModel, MyModelOptions) … … 91 89 }}} 92 90 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.91 MEDIA_URL will be prepended to the above urls, so adjust your paths accordingly. 94 92 95 93 === Using TinyMCE with flatpages ===