decouple the dispatcher (a key, basically) with the actions to take upon receiving such a message. allows us to have multiple actions for one key without weird hacks
17 lines
812 B
Python
17 lines
812 B
Python
"""URL patterns for the dispatcher API."""
|
|
|
|
from django.conf.urls import patterns, url
|
|
|
|
from dispatch.views import (DispatchMessage, DispatcherList, DispatcherDetail, DispatcherActionList,
|
|
DispatcherActionDetail)
|
|
|
|
|
|
urlpatterns = patterns('dispatch.views',
|
|
url(r'^api/dispatchers/$', DispatcherList.as_view(), name='dispatch_api_dispatchers'),
|
|
url(r'^api/dispatchers/(?P<pk>[0-9]+)/$', DispatcherDetail.as_view(), name='dispatch_api_dispatcher_detail'),
|
|
url(r'^api/dispatchers/(?P<pk>[0-9]+)/message$', DispatchMessage.as_view(), name='dispatch_api_dispatch_message'),
|
|
|
|
url(r'^api/actions/$', DispatcherActionList.as_view(), name='dispatch_api_actions'),
|
|
url(r'^api/actions/(?P<pk>[0-9]+)/$', DispatcherActionDetail.as_view(), name='dispatch_api_action_detail'),
|
|
)
|