django_ocr_server/models.py
def is_valid_ocr_md5(md5_value, raise_exception=False):
        """
        This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5.
        :param md5_value:
        :param raise_exception:
        :return: boolean. True if md5 does not already exist
        """
        if not md5_value:
            if raise_exception:
                raise ValidationError(_('The md5 value is empty'))
            else:
                return False
        if OCRedFile.objects.filter(md5=md5_value).exists():
            if raise_exception:
                raise Md5DuplicationError(md5_value)
            else:
                return False
        if OCRedFile.objects.filter(ocred_pdf_md5=md5_value).exists():
            if raise_exception:
                raise Md5PdfDuplicationError(md5_value)
            else:
                return False
        return True

        This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5.
        :param md5_value:
        :param raise_exception:
        :return: boolean. True if md5 does not already exist
        
This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5.
This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5 .
def is_valid_ocr_md5(md5_value, raise_exception=False):
        if not md5_value:
            if raise_exception:
                raise ValidationError(_('The md5 value is empty'))
            else:
                return False
        if OCRedFile.objects.filter(md5=md5_value).exists():
            if raise_exception:
                raise Md5DuplicationError(md5_value)
            else:
                return False
        if OCRedFile.objects.filter(ocred_pdf_md5=md5_value).exists():
            if raise_exception:
                raise Md5PdfDuplicationError(md5_value)
            else:
                return False
        return True
def is_valid_ocr_md5 ( md5_value , raise_exception = False ) : if not md5_value : if raise_exception : raise ValidationError ( _ ( 'The md5 value is empty' ) ) else : return False if OCRedFile . objects . filter ( md5 = md5_value ) . exists ( ) : if raise_exception : raise Md5DuplicationError ( md5_value ) else : return False if OCRedFile . objects . filter ( ocred_pdf_md5 = md5_value ) . exists ( ) : if raise_exception : raise Md5PdfDuplicationError ( md5_value ) else : return False return True
This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5.
This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5 .
"""
        This function validates that the md5 does not already exist in the md5 field and ocred_pdf_md5.
        :param md5_value:
        :param raise_exception:
        :return: boolean. True if md5 does not already exist
        """
boolean. True if md5 does not already exist
boolean . True if md5 does not already exist
md5_value
None
raise_exception
None