コード例 #1
0
ファイル: urls.py プロジェクト: brBart/pombola
    # done
    # url(r'^person/(?P<person_slug>[-\w]+)/appearances/$', ........ ),
    url(r'(?P<person_slug>[-\w]+)/appearances/(?P<speech_tag>[-\w]+)$',
        SAPersonAppearanceView.as_view(),
        name='sa-person-appearance')))

# Add View for person meetings attended
person_patterns.append((url(r'(?P<person_slug>[-\w]+)/attendances/$',
                            views.SAPersonAttendanceView.as_view(),
                            name='sa-person-attendance')))

place_patterns = copy.copy(place_patterns)

new_place_url = url(
    r'^(?P<slug>[-\w]+)/$',
    SAPlaceDetailView.as_view(),
    name='place',
)

new_subplace_url = url(
    r'^(?P<slug>[-\w]+)/places/',
    SAPlaceDetailSub.as_view(sub_page='places'),
    name='place_places',
)

for index, pattern in enumerate(place_patterns):
    if pattern.name == 'place':
        place_patterns[index] = new_place_url
    elif pattern.name == 'place_places':
        place_patterns[index] = new_subplace_url
コード例 #2
0
ファイル: urls.py プロジェクト: ken-muturi/pombola
        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'),

    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'),
)


# Members' interests browser
urlpatterns += patterns('',
    url(
        r'^interests/$',
コード例 #3
0
ファイル: urls.py プロジェクト: Code4SA/pombola
# Catch /person/{person_slug}/appearances/{speech_tag} urls and serve the
# appropriate content.
person_patterns.append((
    # FIXME - implement a redirect to /persons/joe-bloggs#appearances when #930
    # done
    # url(r'^person/(?P<person_slug>[-\w]+)/appearances/$', ........ ),
    url(r'(?P<person_slug>[-\w]+)/appearances/(?P<speech_tag>[-\w]+)$',
        SAPersonAppearanceView.as_view(),
        name='sa-person-appearance')
    ))

place_patterns = copy.copy(place_patterns)

new_place_url = url(
    r'^(?P<slug>[-\w]+)/$',
    SAPlaceDetailView.as_view(),
    name='place',
    )

new_subplace_url = url(
    r'^(?P<slug>[-\w]+)/places/',
    SAPlaceDetailSub.as_view(sub_page='places'),
    name='place_places',
    )

for index, pattern in enumerate(place_patterns):
    if pattern.name == 'place':
        place_patterns[index] = new_place_url
    elif pattern.name == 'place_places':
        place_patterns[index] = new_subplace_url