+ chunk = forms.CharField(required=False)
+ format = forms.CharField(required=False)
+
+ def clean_format(self):
+ value = self.cleaned_data['format']
+ if not value:
+ return 'raw'
+
+ if value not in ('nl', 'raw'):
+ raise forms.ValidationError("Invalid text format")
+ return value