def fix_orientation(self): for page in self.pages.all(): degrees = page.detect_orientation() if degrees: layer_saved_transformations.add_transformation_to( obj=page, transformation_class=TransformationRotate, arguments='{{"degrees": {}}}'.format(360 - degrees) )
def _create_document_transformation(self): layer_saved_transformations.add_transformation_to( obj=self.test_document.pages.first(), transformation_class=TEST_TRANSFORMATION_CLASS, arguments=TEST_TRANSFORMATION_ARGUMENT )