Aleksandr Aleksandr - 5 months ago 27
Python Question

django: disable tinymce for one certain field

I have a lot of models with tinymce(django-tinymce) enabled by default for TextFields and this is ok.
But for one field I don't want to apply tinymce widget (in admin interface).
Please tell me how do I implement that?

class Page(models.Model):
one = models.TextField()
two = models.TextField()
three = models.TextField()


Yes, In your TinyMCE.init(), you would do:

        editor_deselector : "mceNoEditor"

and add the class mceNoEditor to the textarea you want to disable tinymce on.

Here is the relevant documentation

In your example, if you want to disable it on three,

three = models.TextField(widget=form.Textarea(attrs={"class": "mceNoEditor"}))