コード例 #1
0
ファイル: urls.py プロジェクト: TonyFlury/SuffolkCycleDjango
from django.conf.urls import url

from django.contrib import admin
admin.autodiscover()

from views import Main, Detail

app_name = "blog"

urlpatterns = [

    # Main view with optional page
    url(r'^$', Main.as_view(), name="Home"),
    url(r'^page/(?P<page>\d+)$', Main.as_view(), name="Home"),

    # Direct access by slug (one article - no paging)
    url(r'^article/(?P<slug>[\w-]+)$', Detail.as_view(), name="Detail"),

    # Search by tag (main article - supports paging)
    url(r'^search/(?P<tag_slug>[\w-]+)$', Main.as_view(), name="Search"),
    url(r'^search/(?P<tag_slug>[\w-]+)/page/(?P<page>\d+)$', Main.as_view(), name="Search"),

    # Search by date with paging
    url(r'^archive/(?P<year>\d{4})/$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/page/(?P<page>\d+)$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/page/(?P<page>\d+)$', Main.as_view(), name="Archive"),
]
コード例 #2
0
ファイル: urls.py プロジェクト: beda-software/ovz
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='metodical_bank.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='metodical_bank.detail'),
)
コード例 #3
0
ファイル: urls.py プロジェクト: beda-software/ovz
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='schools.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='schools.detail'),
)
コード例 #4
0
ファイル: urls.py プロジェクト: beda-software/ovz
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='your_choice.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='your_choice.detail'),
)
コード例 #5
0
ファイル: urls.py プロジェクト: TonyFlury/SuffolkCycleDjango
from django.contrib import admin
admin.autodiscover()

from views import Main, Detail

app_name = "blog"

urlpatterns = [

    # Main view with optional page
    url(r'^$', Main.as_view(), name="Home"),
    url(r'^page/(?P<page>\d+)$', Main.as_view(), name="Home"),

    # Direct access by slug (one article - no paging)
    url(r'^article/(?P<slug>[\w-]+)$', Detail.as_view(), name="Detail"),

    # Search by tag (main article - supports paging)
    url(r'^search/(?P<tag_slug>[\w-]+)$', Main.as_view(), name="Search"),
    url(r'^search/(?P<tag_slug>[\w-]+)/page/(?P<page>\d+)$',
        Main.as_view(),
        name="Search"),

    # Search by date with paging
    url(r'^archive/(?P<year>\d{4})/$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/page/(?P<page>\d+)$',
        Main.as_view(),
        name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})$',
        Main.as_view(),
        name="Archive"),