1 from django.forms import CharField, ValidationError
2 from .text.textilepl import textile_pl
5 from markupfield.fields import MarkupField
9 def validate_textile(value):
13 raise ValidationError('Syntax error in markup.')
16 class TextileFormField(CharField):
17 default_validators = [validate_textile]
20 class TextileField(MarkupField):
21 def formfield(self, **kwargs):
22 defaults = {'form_class': TextileFormField}
23 defaults.update(kwargs)
24 return super(MarkupField, self).formfield(**defaults)