On Oct 25, 8:47 pm, Bobby Roberts <[EMAIL PROTECTED]> wrote:
> hi.  I'm using django 1.0 over at webfaction.  I have the following
> setup
>
> /static   (serves js, css, flash, images etc)
> /www   (my django app)
>
> I have tiny_mce loaded to /static/js/tiny_mce/
>
> I have followed the steps at this page:  
> http://code.djangoproject.com/wiki/AddWYSIWYGEditor
> in this order:
>
> 1.  Install tiny_mce on your server some where
> 2.  create a textareas.js file  (placed in /static/js/tiny_mce/)
> 3.  created an admin.py file  in my website located at www/learn/ as
> follows:
>
> from django.contrib.flatpages.models import FlatPage
> from django.contrib.flatpages.admin import FlatPageAdmin as
> FlatPageAdminOld
>
> class FlatPageAdmin(FlatPageAdminOld):
>     class Media:
>         js = ('js/tiny_mce/tiny_mce.js',
>               'js/tiny_mce/textareas.js',)
>
> # We have to unregister it, and then reregister
> admin.site.unregister(FlatPage)
> admin.site.register(FlatPage, FlatPageAdmin)
>
> step3 i'm confused on.  This is for newforms with flatpages per the
> documentation.  It is my  understanding that django 1 uses newforms.
> Why won't the admin show the tinymce in place of text areas?

I take it you mean the flat pages part of step 3? I am using TinyMCE
for admin text areas, and it works great. I've never tried it with
flat pages yet. But the reason you have to do that unregister and
register step (for flat pages only), is that because flat pages are a
contributed app, and existing code is already registering a model
admin class for it. If you want to use TinyMCE for flat pages, you
have to create your own model admin for it with the appropriate media
class, undo what the flat pages app already did by unregistering it,
then replacing it with your own.

You don't have to do all that unregister/register stuff for the models
you write.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to