Prepend API to the API views
This commit is contained in:
@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# API Views
|
||||
|
||||
class StagingSourceFileView(generics.GenericAPIView):
|
||||
class APIStagingSourceFileView(generics.GenericAPIView):
|
||||
"""
|
||||
Details of the selected staging file.
|
||||
"""
|
||||
@@ -32,7 +32,7 @@ class StagingSourceFileView(generics.GenericAPIView):
|
||||
return Response(SerializerStagingFolderFile(staging_folder.get_file(encoded_filename=filename), context={'request': request}).data)
|
||||
|
||||
|
||||
class StagingSourceListView(generics.ListAPIView):
|
||||
class APIStagingSourceListView(generics.ListAPIView):
|
||||
"""
|
||||
Returns a list of all the staging folders and the files they contain.
|
||||
"""
|
||||
@@ -41,7 +41,7 @@ class StagingSourceListView(generics.ListAPIView):
|
||||
queryset = StagingFolder.objects.all()
|
||||
|
||||
|
||||
class StagingSourceView(generics.RetrieveAPIView):
|
||||
class APIStagingSourceView(generics.RetrieveAPIView):
|
||||
"""
|
||||
Details of the selected staging folders and the files it contains.
|
||||
"""
|
||||
@@ -49,7 +49,7 @@ class StagingSourceView(generics.RetrieveAPIView):
|
||||
queryset = StagingFolder.objects.all()
|
||||
|
||||
|
||||
class StagingSourceFileImageView(generics.GenericAPIView):
|
||||
class APIStagingSourceFileImageView(generics.GenericAPIView):
|
||||
"""
|
||||
Image of the selected staging file.
|
||||
"""
|
||||
|
||||
@@ -2,8 +2,8 @@ from __future__ import absolute_import
|
||||
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
from .api import (StagingSourceListView, StagingSourceView,
|
||||
StagingSourceFileView, StagingSourceFileImageView)
|
||||
from .api import (APIStagingSourceListView, APIStagingSourceView,
|
||||
APIStagingSourceFileView, APIStagingSourceFileImageView)
|
||||
from .literals import (SOURCE_CHOICE_WEB_FORM, SOURCE_CHOICE_STAGING,
|
||||
SOURCE_CHOICE_WATCH)
|
||||
from .wizards import DocumentCreateWizard
|
||||
@@ -40,8 +40,8 @@ urlpatterns = patterns('sources.views',
|
||||
)
|
||||
|
||||
api_urls = patterns('',
|
||||
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/image/$', StagingSourceFileImageView.as_view(), name='stagingfolderfile-image-view'),
|
||||
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/$', StagingSourceFileView.as_view(), name='stagingfolderfile-detail'),
|
||||
url(r'^staging_folders/$', StagingSourceListView.as_view(), name='stagingfolder-list'),
|
||||
url(r'^staging_folders/(?P<pk>[0-9]+)/$', StagingSourceView.as_view(), name='stagingfolder-detail')
|
||||
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/image/$', APIStagingSourceFileImageView.as_view(), name='stagingfolderfile-image-view'),
|
||||
url(r'^staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/$', APIStagingSourceFileView.as_view(), name='stagingfolderfile-detail'),
|
||||
url(r'^staging_folders/$', APIStagingSourceListView.as_view(), name='stagingfolder-list'),
|
||||
url(r'^staging_folders/(?P<pk>[0-9]+)/$', APIStagingSourceView.as_view(), name='stagingfolder-detail')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user