Created
March 31, 2013 03:01
-
-
Save gu-fan/5279331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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