- generate_dc = forms.BooleanField(required=False, initial=True, label=u"Generate DublinCore template")
+ generate_dc = forms.BooleanField(required=False, \
+ initial=True, label=u"Generate DublinCore template")
+
+
+ def clean(self):
+ clean_data = self.cleaned_data
+
+ ocr_file = clean_data['ocr_file']
+ ocr_data = clean_data['ocr_data']
+
+ if not ocr_file and not ocr_data:
+ raise forms.ValidationError(
+ "You must either provide file descriptor or raw data." )