Exemple #1
0
from django.conf.urls import url

from shelf.views import AuthorListView, AuthorDetailView, BookListView, BookDetailView, PublisherListView, PublisherDetailView

# w urlpattern najpierw wyrazenie regularne, potem co ma pokazac
# jezel icos nie jest zaimportowane to podkresla na czerowo
urlpatterns = [
    url(r'^authors/$', AuthorListView.as_view(), name='author-list'),
    url(r'^authors/(?P<pk>\d+)/$',
        AuthorDetailView.as_view(),
        name='author-detail'),
    url(r'^books/$', BookListView.as_view(), name='book-list'),
    url(r'^books/(?P<pk>\d+)/$', BookDetailView.as_view(), name='book-detail'),
    url(r'^publishers/$', PublisherListView.as_view(), name='publisher-list'),
    url(r'^publishers/(?P<pk>\d+)/$',
        PublisherDetailView.as_view(),
        name='publisher-detail'),
]
Exemple #2
0
# -*- coding: utf-8-sig -*-
from django.conf.urls import patterns, include, url

from shelf.views import (AuthorListView, AuthorDetailView, BookListView, BookDetailView)

urlpatterns = patterns('',
	url(r'^autorzy/$', AuthorListView.as_view(), name='author-list'),
    	url(r'^autorzy/(?P<pk>\d+)/$', AuthorDetailView.as_view(), name='author-detail'),
    	url(r'^ksiazki/$', BookListView.as_view(), name='book-list'),
    	url(r'^ksiazki/(?P<pk>\d+)/$', BookDetailView.as_view(), name='book-detail'),
)
Exemple #3
0
from django.conf.urls import include, url

from shelf.views import (AuthorListView, AuthorDetailView, BookListView,
                         BookDetailView)

urlpatterns = [
    url(r'^autorzy/$', AuthorListView.as_view(), name='author-list'),
    url(r'^autorzy/(?P<pk>\d+)/$',
        AuthorDetailView.as_view(),
        name='author-detail'),
    url(r'^ksiazki/$', BookListView.as_view(), name='book-list'),
    url(r'^ksiazki/(?P<pk>\d+)$', BookDetailView.as_view(),
        name='book-detail'),
]
Exemple #4
0
# -*- coding: utf-8-sig -*-
from django.conf.urls import patterns, include, url

from shelf.views import (AuthorListView, AuthorDetailView, BookListView,
                         BookDetailView)

urlpatterns = patterns(
    '',
    url(r'^autorzy/$', AuthorListView.as_view(), name='author-list'),
    url(r'^autorzy/(?P<pk>\d+)/$',
        AuthorDetailView.as_view(),
        name='author-detail'),
    url(r'^ksiazki/$', BookListView.as_view(), name='book-list'),
    url(r'^ksiazki/(?P<pk>\d+)/$',
        BookDetailView.as_view(),
        name='book-detail'),
)
Exemple #5
0
#from django.conf.urls import url, include, patterns
from django.urls import path, include
from shelf.views import AuthorListView, AuthorDetailView, BookListView, BookDetailView
app_name = 'shelf'

urlpatterns = [
    path('authors/', AuthorListView.as_view(), name='author-view'),
    path(
        'authors/<int:pk>/', AuthorDetailView.as_view(), name='author-detail'
    ),  #<int:id> oznacza, że pojawią się cyfry a id to zmienna przekazywana do widoku
    path('books/<int:pk>/', BookDetailView.as_view(), name='book-detail'),
    path('books/', BookListView.as_view(), name='book-list'),
]