Refactor the OCR app API
This refactor adds two new endpoints to view the OCR content of versions and documents. Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
This commit is contained in:
@@ -2,10 +2,20 @@ from __future__ import unicode_literals
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import DocumentPageOCRContent
|
||||
|
||||
class DocumentOCRSerializer(serializers.Serializer):
|
||||
text = serializers.CharField(
|
||||
read_only=True, source='get_ocr_content'
|
||||
)
|
||||
|
||||
|
||||
class DocumentPageOCRContentSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
fields = ('content',)
|
||||
model = DocumentPageOCRContent
|
||||
class DocumentPageOCRContentSerializer(serializers.Serializer):
|
||||
text = serializers.CharField(
|
||||
read_only=True, source='get_ocr_content'
|
||||
)
|
||||
|
||||
|
||||
class DocumentVersionOCRSerializer(serializers.Serializer):
|
||||
text = serializers.CharField(
|
||||
read_only=True, source='get_ocr_content'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user