urlpatterns = [ url(r'^committee/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^question/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^hansard/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^committee/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), url(r'^question/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), url(r'^hansard/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), ] # Make sure the top level custom indexes work: urlpatterns += patterns( '', url(r'^hansard/$', SAHansardIndex.as_view(), name='section-list-hansard'), url(r'^committee-minutes/$', SACommitteeIndex.as_view(), name='section-list-committee-minutes'), url(r'^question/$', SAQuestionIndex.as_view(), name='section-list-question'), ) # Anything else unmatched we assume is dealt with by SayIt (which will # return a 404 if the path is unknown anyway): fallback_sayit_patterns = patterns( '', # Exposed endpoint for a speech referred to by a numeric ID: url(r'^speech/(?P<pk>\d+)$', SASpeechView.as_view(), name='speech-view'), # Fake endpoint to redirect to the right speaker: url(r'^speaker/(?P<slug>[-\w]+)$',
# Fake endpoint to redirect url(r'^speaker/(?P<pk>\d+)$', SASpeakerRedirectView.as_view(), name='speaker-view'), ) hansard_patterns = sayit_patterns + patterns('', # special Hansard index page that provides listing of the hansard sessions that contain speeches. url(r'^$', SAHansardIndex.as_view(), name='section-list'), ) committee_patterns = patterns('', # Exposed endpoints url(r'^(?P<pk>\d+)$', SACommitteeSectionRedirectView.as_view(), name='section-view'), url(r'^speech/(?P<pk>\d+)$', SACommitteeSpeechRedirectView.as_view(), name='speech-view'), # Fake endpoint to redirect url(r'^speaker/(?P<pk>\d+)$', SASpeakerRedirectView.as_view(), name='speaker-view'), url(r'^$', SACommitteeIndex.as_view(), name='section-list'), ) question_patterns = sayit_patterns + patterns('', # special Hansard index page that provides listing of the hansard sessions that contain speeches. url(r'^$', SAQuestionIndex.as_view(), name='section-list'), ) urlpatterns += patterns('', url(r'^hansard/', include(hansard_patterns, namespace='hansard', app_name='speeches')), url(r'^committee/', include(committee_patterns, namespace='committee', app_name='speeches')), url(r'^question/', include(question_patterns, namespace='question', app_name='speeches')), )
urlpatterns = [ url(r'^committee/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^question/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^hansard/(?P<pk>\d+)$', OldSectionRedirect.as_view()), url(r'^committee/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), url(r'^question/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), url(r'^hansard/speech/(?P<pk>\d+)$', OldSpeechRedirect.as_view()), ] # Make sure the top level custom indexes work: urlpatterns += patterns('', url(r'^hansard/$', SAHansardIndex.as_view(), name='section-list-hansard'), url(r'^committee-minutes/$', SACommitteeIndex.as_view(), name='section-list-committee-minutes'), url(r'^question/$', SAQuestionIndex.as_view(), name='section-list-question'), ) # Anything else unmatched we assume is dealt with by SayIt (which will # return a 404 if the path is unknown anyway): fallback_sayit_patterns = patterns('', # Exposed endpoint for a speech referred to by a numeric ID: url(r'^speech/(?P<pk>\d+)$', SASpeechView.as_view(), name='speech-view'), # Fake endpoint to redirect to the right speaker: url(r'^speaker/(?P<slug>[-\w]+)$', SASpeakerRedirectView.as_view(), name='speaker-view'), # Anything else might be a slug referring to a section: url(r'^(?P<full_slug>.+)$', SASectionView.as_view(), name='section-view'), )