X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/d0dbd3635a4c1d1c47040fd17f5a8d2bec08a7e9..a6694613ce70707661b795a121ef126b11c1777a:/philo/forms/widgets.py diff --git a/philo/forms/widgets.py b/philo/forms/widgets.py deleted file mode 100644 index d223605..0000000 --- a/philo/forms/widgets.py +++ /dev/null @@ -1,30 +0,0 @@ -from django.forms.widgets import Textarea -from django.utils import simplejson as json - -__all__ = ('EmbedWidget',) - -class EmbedWidget(Textarea): - """A form widget with the HTML class embedding and an embedded list of content-types.""" - def __init__(self, attrs=None): - from philo.models import value_content_type_limiter - - content_types = value_content_type_limiter.classes - data = [] - - for content_type in content_types: - data.append({'app_label': content_type._meta.app_label, 'object_name': content_type._meta.object_name.lower(), 'verbose_name': unicode(content_type._meta.verbose_name)}) - - json_ = json.dumps(data) - - default_attrs = {'class': 'embedding vLargeTextField', 'data-content-types': json_ } - - if attrs: - default_attrs.update(attrs) - - super(EmbedWidget, self).__init__(default_attrs) - - class Media: - css = { - 'all': ('philo/css/EmbedWidget.css',), - } - js = ('philo/js/EmbedWidget.js',) \ No newline at end of file