urls.py 2.93 KB
Newer Older
Arnaud Fabre's avatar
Arnaud Fabre committed
1
# coding: utf-8
Jamesie Pic's avatar
Jamesie Pic committed
2
from django.conf.urls import include, url
luxcem's avatar
Init  
luxcem committed
3
from django.contrib import admin
Jamesie Pic's avatar
Jamesie Pic committed
4
from django.views import generic
luxcem's avatar
Init  
luxcem committed
5

6
7
8
from views.dossier_ac import DossierAutocomplete, ProposalAutocomplete
from views.dossier_detail import DossierDetail
from views.dossier_list import DossierList
9
from views.group_ac import GroupAutocomplete
10
11
12
from views.group_list import GroupList
from views.representative_detail import RepresentativeDetail
from views.representative_list import RepresentativeList
13
from views.redirects import RedirectGroupList, RedirectGroupRepresentativeList
14
15
from views.theme_detail import ThemeDetail
from views.theme_list import ThemeList
16

Jamesie Pic's avatar
Jamesie Pic committed
17
import api
luxcem's avatar
luxcem committed
18

Arnaud Fabre's avatar
Arnaud Fabre committed
19
20
admin.autodiscover()

Jamesie Pic's avatar
Jamesie Pic committed
21
22
urlpatterns = [
    # Project-specific overrides
Nicolas Joyard's avatar
Nicolas Joyard committed
23
    url(
24
        r'^legislature/representative/(?P<group_kind>\w+)/(?P<chamber>.+)/' +
Nicolas Joyard's avatar
Nicolas Joyard committed
25
        r'(?P<group>.+)/$',
26
        RedirectGroupRepresentativeList.as_view(),
27
28
29
        name='representative-list'
    ),
    url(
30
        r'^legislature/representative/(?P<group_kind>\w+)/(?P<group>.+)/$',
31
        RedirectGroupRepresentativeList.as_view(),
32
33
34
        name='representative-list'
    ),
    url(
35
36
37
38
39
40
        r'^legislature/representative/$',
        RepresentativeList.as_view(),
        name='representative-list'
    ),
    url(
        r'^legislature/representative/(?P<slug>[-\w]+)/$',
41
42
43
44
        RepresentativeDetail.as_view(),
        name='representative-detail'
    ),
    url(
45
        r'^legislature/group/$',
46
47
48
49
        GroupList.as_view(),
        name='group-list'
    ),
    url(
50
51
52
53
54
55
        r'^legislature/groups/$',
        RedirectGroupList.as_view(),
        name='group-list-redirect'
    ),
    url(
        r'^legislature/group/(?P<kind>\w+)/$',
56
57
58
59
        GroupList.as_view(),
        name='group-list'
    ),
    url(
60
61
62
        r'^legislature/groups/(?P<kind>\w+)/$',
        RedirectGroupList.as_view(),
        name='group-list-redirect'
Nicolas Joyard's avatar
Nicolas Joyard committed
63
    ),
64
65
66
67
68
    url(
        r'^legislature/autocomplete/group/$',
        GroupAutocomplete.as_view(),
        name='group-autocomplete',
    ),
Jamesie Pic's avatar
Jamesie Pic committed
69
    url(
70
        r'^votes/dossier/$',
71
72
        DossierList.as_view(),
        name='dossier-list'
Jamesie Pic's avatar
Jamesie Pic committed
73
74
    ),
    url(
75
        r'^votes/dossier/(?P<pk>\d+)/$',
76
77
        DossierDetail.as_view(),
        name='dossier-detail'
Jamesie Pic's avatar
Jamesie Pic committed
78
79
    ),
    url(
80
81
82
        r'^votes/autocomplete/dossier/$',
        DossierAutocomplete.as_view(),
        name='dossier-autocomplete',
Jamesie Pic's avatar
Jamesie Pic committed
83
84
    ),
    url(
85
86
87
        r'^votes/autocomplete/proposal/$',
        ProposalAutocomplete.as_view(),
        name='proposal-autocomplete',
Jamesie Pic's avatar
Jamesie Pic committed
88
    ),
89
90
91
92
93
94
95
96
97
98
    url(
        r'^theme/$',
        ThemeList.as_view(),
        name='theme-list'
    ),
    url(
        r'^theme/(?P<slug>[-\w]+)/$',
        ThemeDetail.as_view(),
        name='theme-detail'
    ),
Jamesie Pic's avatar
Jamesie Pic committed
99

luxcem's avatar
Init  
luxcem committed
100
    url(r'^admin/', include(admin.site.urls)),
Jamesie Pic's avatar
Jamesie Pic committed
101
    url(r'^positions/', include('representatives_positions.urls',
Jamesie Pic's avatar
Jamesie Pic committed
102
        namespace='representatives_positions')),
Jamesie Pic's avatar
Jamesie Pic committed
103
    url(r'^api/', include(api.router.urls)),
Jamesie Pic's avatar
Jamesie Pic committed
104
105
    url(r'^$', generic.TemplateView.as_view(template_name='home.html')),
]