Change the way API endpoints are registered
This commit is contained in:
@@ -6,7 +6,10 @@ from common.utils import encapsulate
|
||||
from documents.models import Document
|
||||
from navigation.api import register_links, register_model_list_columns
|
||||
from project_setup.api import register_setup
|
||||
from rest_api.classes import EndPoint
|
||||
|
||||
from .api import (APIStagingSourceListView, APIStagingSourceView,
|
||||
APIStagingSourceFileView, APIStagingSourceFileImageView)
|
||||
from .classes import StagingFile
|
||||
from .links import (document_create_multiple, document_create_siblings,
|
||||
staging_file_delete, setup_sources, setup_web_form_list,
|
||||
@@ -17,6 +20,7 @@ from .links import (document_create_multiple, document_create_siblings,
|
||||
upload_version)
|
||||
from .models import (WebForm, StagingFolder, SourceTransformation,
|
||||
WatchFolder)
|
||||
from .urls import api_urls
|
||||
from .widgets import staging_file_thumbnail
|
||||
|
||||
register_links([StagingFile], [staging_file_delete])
|
||||
@@ -53,3 +57,6 @@ register_setup(setup_sources)
|
||||
|
||||
register_links([Document, 'document_list_recent', 'document_list', 'document_create', 'document_create_multiple', 'upload_interactive', 'staging_file_delete'], [document_create_multiple], menu_name='secondary_menu')
|
||||
register_links(Document, [document_create_siblings])
|
||||
|
||||
endpoint = EndPoint('sources')
|
||||
endpoint.register_urls(api_urls)
|
||||
|
||||
@@ -37,13 +37,11 @@ urlpatterns = patterns('sources.views',
|
||||
|
||||
url(r'^create/from/local/multiple/$', DocumentCreateWizard.as_view(), name='document_create_multiple'),
|
||||
url(r'^(?P<document_id>\d+)/create/siblings/$', 'document_create_siblings', (), 'document_create_siblings'),
|
||||
)
|
||||
|
||||
|
||||
#version_0_api_services = [
|
||||
url(r'^api/staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/image/$', APIStagingSourceFileImageView.as_view(), name='stagingfolderfile-image-view'),
|
||||
url(r'^api/staging_folders/file/(?P<staging_folder_pk>[0-9]+)/(?P<filename>.+)/$', APIStagingSourceFileView.as_view(), name='stagingfolderfile-detail'),
|
||||
url(r'^api/staging_folders/$', APIStagingSourceListView.as_view(), name='stagingfolder-list'),
|
||||
url(r'^api/staging_folders/(?P<pk>[0-9]+)/$', APIStagingSourceView.as_view(), name='stagingfolder-detail')
|
||||
#]
|
||||
|
||||
api_urls = patterns('',
|
||||
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