X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/6dc154ec98d58159b3e75447ce7b7fe5642acec4..61b73fe068172f02d6c47e2b5387161919ec9618:/philo/models/fields/__init__.py diff --git a/philo/models/fields/__init__.py b/philo/models/fields/__init__.py index 575b3a4..7ab4326 100644 --- a/philo/models/fields/__init__.py +++ b/philo/models/fields/__init__.py @@ -9,20 +9,14 @@ from django.utils.translation import ugettext_lazy as _ from philo.forms.fields import JSONFormField from philo.utils.registry import RegistryIterator from philo.validators import TemplateValidator, json_validator -from philo.forms.widgets import EmbedWidget #from philo.models.fields.entities import * -class TemplateField(models.Field): +class TemplateField(models.TextField): """A :class:`TextField` which is validated with a :class:`.TemplateValidator`. ``allow``, ``disallow``, and ``secure`` will be passed into the validator's construction.""" def __init__(self, allow=None, disallow=None, secure=True, *args, **kwargs): super(TemplateField, self).__init__(*args, **kwargs) self.validators.append(TemplateValidator(allow, disallow, secure)) - - def formfield(self, **kwargs): - defaults = {'widget': EmbedWidget} - defaults.update(kwargs) - return super(TemplateField, self).formfield(**defaults) class JSONDescriptor(object):