X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/40a38822c70cb40ccda6770fe81d74624ecaecd7..0bd2c341a8b55f817c2e193a6c4658d52ef95961:/apps/api/urls.py diff --git a/apps/api/urls.py b/apps/api/urls.py index 8a1451909..0267ba097 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- -from django.conf.urls.defaults import * +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django.conf.urls import patterns, url from django.views.decorators.csrf import csrf_exempt from django.views.generic import TemplateView from piston.authentication import OAuthAuthentication, oauth_access_token @@ -19,6 +22,9 @@ ebook_list_resource = Resource(handler=handlers.EBooksHandler) #book_list_resource = Resource(handler=handlers.BooksHandler) book_resource = Resource(handler=handlers.BookDetailHandler) +collection_resource = Resource(handler=handlers.CollectionDetailHandler) +collection_list_resource = Resource(handler=handlers.CollectionsHandler) + tag_list_resource = Resource(handler=handlers.TagsHandler) tag_resource = Resource(handler=handlers.TagDetailHandler) @@ -48,6 +54,10 @@ urlpatterns = patterns( url(r'tag/(?P\d*?)/info\.html$', 'catalogue.views.tag_info'), + # books by collections + url(r'^collections/$', collection_list_resource, name="api_collections"), + url(r'^collections/(?P[^/]+)/$', collection_resource, name="api_collection"), + # objects details url(r'^books/(?P[a-z0-9-]+)/$', book_resource, name="api_book"), url(r'^(?P[a-z0-9-]+)/(?P[a-z0-9-]+)/$',