Thursday, June 9, 2016

Re: Adding Tinymce to Admin

I'm pretty sure you can specify a widget to use in admin for each model and field.

Part 7 of the tutorial will show you how to alter the admin without changing the file in the virtualenv.
The documentation on ModelAdmin have an example of what you are trying to do :)

+33614874342

On 8 Jun 2016 6:56 p.m., "Ankush Thakur" <ankush.thakur53@gmail.com> wrote:
I wish to add TinyMCE editor to my Django-powered app. My Model is a typical blog model, with a TextField for the actual post contents. Now what I want is, every time I'm editing the contents (or adding a new blog), I should be able to write in a WordPress-style editor. 

I understand that I'd need to add some third-party app for TinyMCE and then set it as a widget, but my problem is that the admin templates do not reside in my project Git repository. They are in the virtualenv directory, and I'm not sure how I'll be able to integrate them into my project.

A little voice at the back of my head tells me that I won't need to alter Admin, but I'm not sure. Because I don't have any forms (I directly edit/create from the Admin), I don't think I can get away with only saying something like 'content = models.TextField(widget='tinymce')'?

Regards,
Ankush Thakur

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALX%3DrKLBResPR-n8SCibpckFAN5PwhHWSH5xBgEnmPaGLUvsrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTbDaS1dWsZFxaHpecMRL6BW_jHLZd_6N8_isnceyVUdSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment