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'), ) urlpatterns += patterns( '', url( r'', include(fallback_sayit_patterns, namespace='sayit', app_name='speeches')), )
url(r'^place/(?P<slug>[-\w]+)/places/', SAPlaceDetailSub.as_view(), {'sub_page': 'places'}, name='place_places'), # Catch the newsletter info page to change the template used so that the signup form is injected. # NOTE - you still need to create an InfoPage with the slug 'newsletter' for this not to 404. url(r'^info/newsletter', SANewsletterPage.as_view(), {'slug': 'newsletter'}, name='info_page_newsletter'), ) sayit_patterns = patterns('', # Exposed endpoints url(r'^(?P<pk>\d+)$', SectionView.as_view(), name='section-view'), url(r'^speech/(?P<pk>\d+)$', SpeechView.as_view(), name='speech-view'), # 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'^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'), ) urlpatterns += patterns('', url(r'', include(fallback_sayit_patterns, namespace='sayit', app_name='speeches')), )