Add API endpoint to create a document based off a document source

This commit is contained in:
Roberto Rosario
2014-10-08 01:51:15 -04:00
parent 4b6c826574
commit b0d6ccbe89
4 changed files with 84 additions and 6 deletions

View File

@@ -2,8 +2,9 @@ from __future__ import absolute_import
from django.conf.urls import patterns, url
from .api_views import (APIStagingSourceFileView, APIStagingSourceFileImageView,
APIStagingSourceListView, APIStagingSourceView)
from .api_views import (APIDocumentCreateView, APIStagingSourceFileView,
APIStagingSourceFileImageView, APIStagingSourceListView,
APIStagingSourceView)
from .literals import (SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH,
SOURCE_CHOICE_WEB_FORM)
from .wizards import DocumentCreateWizard
@@ -40,6 +41,7 @@ urlpatterns = patterns('sources.views',
)
api_urls = patterns('',
url(r'^document/create/$', APIDocumentCreateView.as_view(), name='document-create-view'),
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<encoded_filename>.+)/image/$', APIStagingSourceFileImageView.as_view(), name='stagingfolderfile-image-view'),
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<encoded_filename>.+)/$', APIStagingSourceFileView.as_view(), name='stagingfolderfile-detail'),
url(r'^staging_folders/$', APIStagingSourceListView.as_view(), name='stagingfolder-list'),