コード例 #1
0
ファイル: urls.py プロジェクト: brBart/pombola
            election_type='provincial'),
        name='sa-election-candidates-provincial',
    ),
    # Provincial election, party list
    url(
        r'^election/(?P<election_year>[-\w]+)/provincial/(?P<province_name>[-\w]+)/(?P<party_name>[-\w]+)/$',
        views.SAElectionPartyCandidatesView.as_view(
            election_type='provincial'),
        name='sa-election-candidates-provincial-party',
    ),
)

for index, pattern in enumerate(search_urlpatterns):
    if pattern.name == 'core_search':
        search_urlpatterns[index] = url(r'^$',
                                        SASearchView.as_view(),
                                        name='core_search')

urlpatterns += (
    # We want to override the location search view, so that we can
    # redirect straight to the results page if there's a unique result
    # returned.
    url(r'^search/location/$',
        SAGeocoderView.as_view(),
        name='core_geocoder_search'),

    # 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'),
コード例 #2
0
ファイル: urls.py プロジェクト: ken-muturi/pombola
    url(
        r'^election/(?P<election_year>[-\w]+)/provincial/(?P<province_name>[-\w]+)/$',
        views.SAElectionProvinceCandidatesView.as_view(election_type='provincial'),
        name='sa-election-candidates-provincial',
    ),
    # Provincial election, party list
    url(
        r'^election/(?P<election_year>[-\w]+)/provincial/(?P<province_name>[-\w]+)/(?P<party_name>[-\w]+)/$',
        views.SAElectionPartyCandidatesView.as_view(election_type='provincial'),
        name='sa-election-candidates-provincial-party',
    ),
)

for index, pattern in enumerate(search_urlpatterns):
    if pattern.name == 'core_search':
        search_urlpatterns[index] = url(r'^$', SASearchView.as_view(), name='core_search')

urlpatterns += patterns('pombola.south_africa.views',
    url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/national/$', LatLonDetailNationalView.as_view(), name='latlon-national'),
    url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/$', LatLonDetailLocalView.as_view(), name='latlon'),

    # We want to override the location search view, so that we can
    # redirect straight to the results page if there's a unique result
    # returned.
    url(r'^search/location/$', SAGeocoderView.as_view(), name='core_geocoder_search'),

    # because the following slug matches override this definition in the core
    # place_patterns, we reinstate it here
    url( r'^place/all/', PlaceKindList.as_view(), name='place_kind_all' ),

    url(r'^place/(?P<slug>[-\w]+)/$', SAPlaceDetailView.as_view(), name='place'),
コード例 #3
0
            election_type='provincial'),
        name='sa-election-candidates-provincial',
    ),
    # Provincial election, party list
    url(
        r'^election/(?P<election_year>[-\w]+)/provincial/(?P<province_name>[-\w]+)/(?P<party_name>[-\w]+)/$',
        views.SAElectionPartyCandidatesView.as_view(
            election_type='provincial'),
        name='sa-election-candidates-provincial-party',
    ),
)

for index, pattern in enumerate(search_urlpatterns):
    if pattern.name == 'core_search':
        search_urlpatterns[index] = url(r'^$',
                                        SASearchView(),
                                        name='core_search')

urlpatterns += patterns(
    'pombola.south_africa.views',
    url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/national/$',
        LatLonDetailNationalView.as_view(),
        name='latlon-national'),
    url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/$',
        LatLonDetailLocalView.as_view(),
        name='latlon'),

    # We want to override the location search view, so that we can
    # redirect straight to the results page if there's a unique result
    # returned.
    url(r'^search/location/$',