Refactor the parsing app API

Add additional API and view tests.

Add success and multi document titles strings.

Make use of external mixin in the document type submit view.

Puntuate all view text strings.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-02-22 23:46:15 -04:00
parent 3917ca667a
commit d546967d1d
8 changed files with 466 additions and 155 deletions

View File

@@ -2,7 +2,10 @@ from __future__ import unicode_literals
from django.conf.urls import url
from .api_views import APIDocumentPageContentView
from .api_views import (
DocumentParsingAPIViewSet, DocumentPageParsingAPIViewSet,
DocumentVersionParsingAPIViewSet
)
from .views import (
DocumentContentDownloadView, DocumentContentView, DocumentPageContentView,
DocumentParsingErrorsListView, DocumentSubmitView,
@@ -51,10 +54,20 @@ urlpatterns = [
)
]
api_urls = [
url(
regex=r'^documents/(?P<document_id>\d+)/versions/(?P<document_version_id>\d+)/pages/(?P<document_page_id>\d+)/content/$',
view=APIDocumentPageContentView.as_view(),
name='document-page-content-view'
)
]
api_router_entries = (
{
'prefix': r'documents',
'viewset': DocumentParsingAPIViewSet, 'basename': 'document-parsing'
},
{
'prefix': r'documents/(?P<document_id>\d+)/document_versions',
'viewset': DocumentVersionParsingAPIViewSet,
'basename': 'document_version-parsing'
},
{
'prefix': r'documents/(?P<document_id>\d+)/document_versions/(?P<document_version_id>\d+)/document_pages',
'viewset': DocumentPageParsingAPIViewSet,
'basename': 'document_page-parsing'
},
)