Skip to content

Instantly share code, notes, and snippets.

@gu-fan
Created March 31, 2013 03:01
Show Gist options
  • Save gu-fan/5279331 to your computer and use it in GitHub Desktop.
Save gu-fan/5279331 to your computer and use it in GitHub Desktop.
from django import forms
from django.conf import settings
class KindWidget(forms.Textarea):
"""
Setup the JS files and targetting CSS class for a textarea to
use TinyMCE.
"""
class Media:
js = (settings.STATIC_URL + 'js/widgets/kindeditor.js',
settings.STATIC_URL + 'js/widgets/init.js',)
def __init__(self, *args, **kwargs):
super(KindWidget, self).__init__(*args, **kwargs)
self.attrs["class"] = "kind"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment