Beispiel #1
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.views.generic import TemplateView
from views import AboutView, BookListView, MyView, PublisherList, PublisherBookList, AuthorDetailView
from django.contrib.auth.decorators import login_required

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^about/', AboutView.as_view()),
    url(r'^demo/$', BookListView.as_view()),
    url(r'^myview/$', MyView.as_view()),

    url(r'^publishers/$', PublisherList.as_view()),

    url(r'^books/([\w-]+)/$', PublisherBookList.as_view()),
    url(r'^authors/(?P<pk>[0-9]+)/$', AuthorDetailView.as_view(), name='author-detail'),
]
Beispiel #2
0
from django.conf.urls import url
from views import AuthorListView, AuthorDetailView, AuthorCreateView, AuthorDeleteView, AuthorUpdateView

urlpatterns = [
    url(r'^create_author/$', AuthorCreateView.as_view(), name='create_view'),
    url(r'^$', AuthorListView.as_view(), name='list_view'),
    url(r'^(?P<pk>\d+)/$', AuthorDetailView.as_view(), name='detail_view'),
    url(r'^update/(?P<pk>\d+)/$', AuthorUpdateView.as_view(), name='update_view'),
    url(r'^delete/(?P<pk>\d+)/$', AuthorDeleteView.as_view(), name='delete_view'),
]

Beispiel #3
0
from django.conf.urls.defaults import patterns, url

from views import AuthorListView, AuthorDetailView

urlpatterns = patterns('',
    # Examples:
    url(r'^$', AuthorListView.as_view(), name='authors'),
    url(r'^(?P<pk>\d+)/$', AuthorDetailView.as_view(), name='authors-detail'),
)
Beispiel #4
0
from django.conf.urls import patterns, url
from views import TalkListView, TalkDetailView, IndexView, AuthorDetailView, ZoneDetailView, RoomDetailView, NowListView, DayTalkListView, AboutView, SearchTalkListView
from django.views.generic import ListView
from grade.models import Zone, Room, Talk
from django.views.generic.base import RedirectView

urlpatterns = patterns('grade.views',
    url(r'^palestras/$', TalkListView.as_view(), name='talks'),
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^palestras/(?P<pk>\d+)/$', TalkDetailView.as_view(),
        name='talk'),
    url(r'^palestras/(?P<talk_id>\d+)/assistir/$', "choice_talk",
        name="choice_talk"),
    url(r"^gerar_grade/", 'gerar_grade', name="gerar_grade"),
    url(r'^palestrantes/(?P<pk>\d+)/$', AuthorDetailView.as_view(),
        name='author'),
    url(r'^trilhas/$', ListView.as_view(
        model=Zone,
        context_object_name="zone_list")),
    url(r'^trilhas/(?P<pk>\d+)/$', ZoneDetailView.as_view(),
    name='zone'),
    url(r'^salas/$', ListView.as_view(
        model=Room,
        context_object_name="rooms")),
    url(r'^salas/(?P<pk>\d+)/$', RoomDetailView.as_view(),
    name='room'),
    url(r'^dia/(\w+)/$', DayTalkListView.as_view()),
    url(r'^dia/$', ListView.as_view(
        queryset=Talk.objects.dates("date", "day"),
        template_name="grade/days_list.html",
        context_object_name="days")),
Beispiel #5
0
from django.conf.urls import url
from views import BookDetailView, BookListView, AuthorListView, AuthorDetailView

urlpatterns = [
    url(r'^book/detail/(?P<pk>[\d]+)/$', BookDetailView.as_view(), name='book-detail'),
    url(r'^book/list/$', BookListView.as_view(), name='book-list'),
    url(r'^author/detail/(?P<pk>[\d]+)/$', AuthorDetailView.as_view(), name='author-detail'),
    url(r'^author/list/$', AuthorListView.as_view(), name='author-list'),
]