urls.py 1.36 KB
Newer Older
okhin's avatar
okhin committed
1
from django.conf import settings
okhin's avatar
okhin committed
2
from django.conf.urls import include, url
Aymeric Barantal's avatar
Aymeric Barantal committed
3
from django.contrib import admin
Aymeric Barantal's avatar
Aymeric Barantal committed
4
from rest_framework_nested import routers
Aymeric Barantal's avatar
Aymeric Barantal committed
5

6 7
from picampaign.campaign.views import (CampaignViewSet, CampaignContactViewSet,
                                       ArgumentaryViewSet)
8
from picampaign.feedback.views import FeedbackViewSet
okhin's avatar
okhin committed
9 10
from picampaign.organization.views import (CategoryViewSet, GroupTypeViewSet,
                                            GroupViewSet, OrganizationViewSet)
Aymeric Barantal's avatar
Aymeric Barantal committed
11 12 13 14 15 16 17

router = routers.SimpleRouter()
router.register(r'campaigns', CampaignViewSet)

campaign_router = routers.NestedSimpleRouter(router, r'campaigns',
                                             lookup='campaign')
campaign_router.register(r'contacts', CampaignContactViewSet)
18
campaign_router.register(r'arguments', ArgumentaryViewSet)
19
campaign_router.register(r'categories', CategoryViewSet)
20
campaign_router.register(r'feedbacks', FeedbackViewSet)
okhin's avatar
okhin committed
21
campaign_router.register(r'grouptypes', GroupTypeViewSet)
okhin's avatar
okhin committed
22
campaign_router.register(r'groups', GroupViewSet)
okhin's avatar
okhin committed
23
campaign_router.register(r'organization', OrganizationViewSet)
Aymeric Barantal's avatar
Aymeric Barantal committed
24

Aymeric Barantal's avatar
Aymeric Barantal committed
25

okhin's avatar
okhin committed
26 27 28
urlpatterns = [
       url(r'^admin/', include(admin.site.urls)),
       url(r'^', include(router.urls)),
okhin's avatar
okhin committed
29
       url(r'^', include(campaign_router.urls)),
okhin's avatar
okhin committed
30
       url(r'^i18n/', include('django.conf.urls.i18n')),
okhin's avatar
okhin committed
31
       url(r'^docs/', include('rest_framework_docs.urls'))
okhin's avatar
okhin committed
32
    ]