Refactor rest_api app and the method end points are registered. All apps API URL endpoints are now registered under the 'rest_api' namespace.

Update DRF and DRF swagger versions. Update all apps API registration method.
This commit is contained in:
Roberto Rosario
2015-08-06 02:51:23 -04:00
parent ea02172a82
commit 960d60c39d
23 changed files with 680 additions and 418 deletions

View File

@@ -99,11 +99,12 @@ def document_html_widget(document_page, click_view=None, click_view_arguments=No
alt_text = _('Document page image')
if not document_page:
return mark_safe('<span class="fa-stack fa-lg"><i class="fa fa-file-o fa-stack-2x"></i><i class="fa fa-question fa-stack-1x text-danger"></i></span>')
document = document_page.document
page = document_page.page_number
query_dict = {
'page': page,
'zoom': zoom,
'rotation': rotation,
'size': size,
@@ -117,12 +118,12 @@ def document_html_widget(document_page, click_view=None, click_view_arguments=No
query_string = urlencode(query_dict)
preview_view = '%s?%s' % (
reverse('document-image', args=[document.pk]), query_string
reverse('rest_api:documentpage-image', args=[document_page.pk]), query_string
)
result.append(
'<div class="tc" id="document-%d-%d">' % (
document.pk, page if page else 1
document.pk, document_page.page_number if document_page.page_number else 1
)
)