urls.py 2.59 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
14

Jamesie Pic's avatar
Jamesie Pic committed
15
import api
luxcem's avatar
luxcem committed
16

Arnaud Fabre's avatar
Arnaud Fabre committed
17
18
admin.autodiscover()

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

luxcem's avatar
Init  
luxcem committed
88
    url(r'^admin/', include(admin.site.urls)),
Jamesie Pic's avatar
Jamesie Pic committed
89
    url(r'^positions/', include('representatives_positions.urls',
Jamesie Pic's avatar
Jamesie Pic committed
90
        namespace='representatives_positions')),
Jamesie Pic's avatar
Jamesie Pic committed
91
    url(r'^api/', include(api.router.urls)),
Jamesie Pic's avatar
Jamesie Pic committed
92
93
    url(r'^$', generic.TemplateView.as_view(template_name='home.html')),
]