django_ocr_server/models.py
def remove_pdf(self):
        """
        This function removes self.pdf.file from a disk if it exists,
        renames self.pdf.name to 'pdf_removed' and then saves the model instance
        :return: None
        """
        self.is_saved()  # checking that instance of OCRedFile is saved, raise DoesNotSaved exception otherwise
        if self.ocred_pdf:
            if os.path.isfile(self.ocred_pdf.path):
                os.remove(self.ocred_pdf.path)
            self.ocred_pdf.name = getattr(settings, 'OCR_PDF_REMOVED_LABEL', ocr_default_settings.PDF_REMOVED_LABEL)
            OCRedFile.Counters.num_removed_pdf += 1
            super(OCRedFile, self).save()

        This function removes self.pdf.file from a disk if it exists,
        renames self.pdf.name to 'pdf_removed' and then saves the model instance
        :return: None
        
This function removes self.pdf.file from a disk if it exists,
renames self.pdf.name to 'pdf_removed' and then saves the model instance
This function removes self . pdf . file from a disk if it exists renames self . pdf . name to ' pdf_removed ' and then saves the model instance
def remove_pdf(self):
        self.is_saved()  
        if self.ocred_pdf:
            if os.path.isfile(self.ocred_pdf.path):
                os.remove(self.ocred_pdf.path)
            self.ocred_pdf.name = getattr(settings, 'OCR_PDF_REMOVED_LABEL', ocr_default_settings.PDF_REMOVED_LABEL)
            OCRedFile.Counters.num_removed_pdf += 1
            super(OCRedFile, self).save()
def remove_pdf ( self ) : self . is_saved ( ) if self . ocred_pdf : if os . path . isfile ( self . ocred_pdf . path ) : os . remove ( self . ocred_pdf . path ) self . ocred_pdf . name = getattr ( settings , 'OCR_PDF_REMOVED_LABEL' , ocr_default_settings . PDF_REMOVED_LABEL ) OCRedFile . Counters . num_removed_pdf += 1 super ( OCRedFile , self ) . save ( )
This function removes self.pdf.file from a disk if it exists,
renames self.pdf.name to 'pdf_removed' and then saves the model instance
This function removes self . pdf . file from a disk if it exists renames self . pdf . name to ' pdf_removed ' and then saves the model instance
"""
        This function removes self.pdf.file from a disk if it exists,
        renames self.pdf.name to 'pdf_removed' and then saves the model instance
        :return: None
        """ # checking that instance of OCRedFile is saved, raise DoesNotSaved exception otherwise
None
self