API Reference

django-tinymce4-lite

This application provides a rich-text WYSIWYG TinyMCE 4 widget for Django forms and models.

class tinymce.HTMLField(*args, **kwargs)[source]

Bases: django.db.models.fields.TextField

A text area model field for HTML content.

It uses the TinyMCE 4 widget in forms.

Example:

from django.db.models import Model
from tinymce import HTMLField

class Foo(Model):
    html_content = HTMLField('HTML content')
formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

class tinymce.TinyMCE(attrs=None, mce_attrs=None, profile=None)[source]

Bases: django.forms.widgets.Textarea

TinyMCE 4 widget

It replaces a textarea form widget with a rich-text WYSIWYG TinyMCE 4 editor widget.

Parameters
  • attrs (dict) – General Django widget attributes.

  • mce_attrs (dict) – Additional configuration parameters for TinyMCE 4. They amend the existing configuration.

  • profile (dict) – TinyMCE 4 configuration parameters. They replace the existing configuration.

build_attrs(base_attrs, extra_attrs=None, **kwargs)[source]

Build an attribute dictionary.

render(name, value, attrs=None, renderer=None)[source]

Render the widget as an HTML string.

class tinymce.AdminTinyMCE(attrs=None, mce_attrs=None, profile=None)[source]

Bases: tinymce.widgets.TinyMCE, django.contrib.admin.widgets.AdminTextareaWidget

TinyMCE 4 widget for Django Admin interface