5 from django.contrib import admin |
5 from django.contrib import admin |
6 from django.views.generic.simple import direct_to_template |
6 from django.views.generic.simple import direct_to_template |
7 from django.conf.urls.defaults import * |
7 from django.conf.urls.defaults import * |
8 |
8 |
9 admin.autodiscover() |
9 admin.autodiscover() |
|
10 |
|
11 PROGRAM_PATTERN_CORE = r'[a-z](?:[0-9a-z]|_[0-9a-z])*' |
|
12 EVENT_PATTERN_CORE =r'(?:[0-9a-z]|_[0-9a-z])*' |
|
13 SCOPE_ARG_PATTERN = r'(?P<scope>%s/%s)' % ( |
|
14 PROGRAM_PATTERN_CORE, EVENT_PATTERN_CORE) |
10 |
15 |
11 # Admin |
16 # Admin |
12 urlpatterns = patterns('', |
17 urlpatterns = patterns('', |
13 url(r'^$', direct_to_template, {"template": "home.html"}, name='home'), |
18 url(r'^$', direct_to_template, {"template": "home.html"}, name='home'), |
14 (r'^comments/', include('django.contrib.comments.urls')), |
19 (r'^comments/', include('django.contrib.comments.urls')), |
25 name='scipycon_list_talk'), |
30 name='scipycon_list_talk'), |
26 ) |
31 ) |
27 |
32 |
28 # Registration |
33 # Registration |
29 urlpatterns += patterns('project.scipycon.registration.views', |
34 urlpatterns += patterns('project.scipycon.registration.views', |
30 url(r'^registrations/$', 'registrations', name='scipycon_registrations'), |
35 url(r'^%s/registrations/$' % (SCOPE_ARG_PATTERN), 'registrations', |
31 url(r'^submit-registration/$', 'submit_registration', name='scipycon_submit_registration'), |
36 name='scipycon_registrations'), |
32 url(r'^edit-registration/(?P<id>\d+)/$', 'edit_registration', |
37 url(r'^%s/submit-registration/$' % (SCOPE_ARG_PATTERN), |
33 name='scipycon_edit_registration'), |
38 'submit_registration', name='scipycon_submit_registration'), |
34 url(r'^download_csv/', 'download_csv', name="download_csv"), |
39 url(r'^%s/edit-registration/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN), |
|
40 'edit_registration', name='scipycon_edit_registration'), |
|
41 url(r'^%s/download_csv/' % (SCOPE_ARG_PATTERN), |
|
42 'download_csv', name="download_csv"), |
35 ) |
43 ) |
36 |
44 |
37 |
45 |
38 # Authentication and Profile |
46 # Authentication and Profile |
39 urlpatterns += patterns('project.scipycon.user.views', |
47 urlpatterns += patterns('project.scipycon.user.views', |