X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0e87ae0739ed3e72301b7b718098f97a7f06a5d8..0966a5718a1735d063c8f99471138c2b1924f2b7:/apps/api/urls.py?ds=sidebyside diff --git a/apps/api/urls.py b/apps/api/urls.py index 8b1b9b0cb..536454f2f 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -1,17 +1,20 @@ # -*- coding: utf-8 -*- from django.conf.urls.defaults import * from piston.resource import Resource -from piston.authentication import HttpBasicAuthentication -from api.handlers import BookHandler +from api import handlers -auth = HttpBasicAuthentication(realm='My sample API') -book_resource = Resource(handler=BookHandler, authentication=auth) - +book_changes_resource = Resource(handler=handlers.BookChangesHandler) +tag_changes_resource = Resource(handler=handlers.TagChangesHandler) +changes_resource = Resource(handler=handlers.ChangesHandler) urlpatterns = patterns('', - url(r'^books/(?P[^/]+)\.(?Pxml|json|yaml)$', book_resource), - url(r'^books\.(?Pxml|json|yaml)$', book_resource), -) + url(r'^book_changes/(?P\d*?)\.(?Pxml|json|yaml)$', book_changes_resource), + url(r'^tag_changes/(?P\d*?)\.(?Pxml|json|yaml)$', tag_changes_resource), + url(r'^changes/(?P\d*?)\.(?Pxml|json|yaml)$', changes_resource), + + url(r'book/(?P\d*?)/info\.html$', 'catalogue.views.book_info'), + url(r'tag/(?P\d*?)/info\.html$', 'catalogue.views.tag_info'), +)