2011-09-12 20:02:06 +00:00
|
|
|
from tastypie.api import Api
|
2013-06-03 16:31:39 +00:00
|
|
|
|
2016-04-08 00:38:53 +00:00
|
|
|
from django.conf.urls import patterns, url, include
|
2011-10-22 15:18:04 +00:00
|
|
|
from django.views.generic.base import TemplateView
|
2011-09-12 20:02:06 +00:00
|
|
|
|
2011-09-15 22:33:05 +00:00
|
|
|
from regluit.api import resources
|
2013-06-03 16:31:39 +00:00
|
|
|
from regluit.api.views import ApiHelpView
|
2014-07-16 23:47:32 +00:00
|
|
|
from regluit.api.views import OPDSNavigationView, OPDSAcquisitionView
|
2015-08-27 01:35:29 +00:00
|
|
|
from regluit.api.views import OnixView
|
2016-11-21 19:14:30 +00:00
|
|
|
from regluit.api.views import (
|
|
|
|
travisci_webhook,
|
|
|
|
load_yaml,
|
|
|
|
negotiate_content,
|
|
|
|
widget,
|
|
|
|
featured_cover,
|
|
|
|
featured_url,
|
|
|
|
)
|
2014-07-16 23:47:32 +00:00
|
|
|
|
2011-09-12 22:44:20 +00:00
|
|
|
|
2011-09-15 22:33:05 +00:00
|
|
|
v1_api = Api(api_name='v1')
|
|
|
|
v1_api.register(resources.WorkResource())
|
2012-01-10 20:20:02 +00:00
|
|
|
v1_api.register(resources.IdentifierResource())
|
2011-09-15 22:33:05 +00:00
|
|
|
v1_api.register(resources.EditionResource())
|
|
|
|
v1_api.register(resources.CampaignResource())
|
|
|
|
v1_api.register(resources.AuthorResource())
|
|
|
|
v1_api.register(resources.SubjectResource())
|
2015-12-19 01:21:28 +00:00
|
|
|
v1_api.register(resources.FreeResource())
|
2017-06-29 17:22:58 +00:00
|
|
|
v1_api.register(resources.PublisherResource())
|
|
|
|
v1_api.register(resources.EbookResource())
|
2011-09-12 20:02:06 +00:00
|
|
|
|
2016-07-27 17:02:47 +00:00
|
|
|
urlpatterns = [
|
2011-10-20 00:08:17 +00:00
|
|
|
url(r'^help$', ApiHelpView.as_view(), name="api_help"),
|
2016-11-21 19:14:30 +00:00
|
|
|
url(r'^widget/(?P<isbn>\w+)/$', widget, name="widget"),
|
|
|
|
url(r'^featured_cover$', featured_cover, name="featured_cover"),
|
|
|
|
url(r'^featured_url$', featured_url, name="featured_url"),
|
2014-07-16 23:47:32 +00:00
|
|
|
url(r"^opds/$", OPDSNavigationView.as_view(template_name="opds.xml"), name="opds"),
|
2017-02-11 20:58:54 +00:00
|
|
|
url(r"^opdsjson/$", OPDSNavigationView.as_view(template_name="opds.json", json=True), name="opdsjson"),
|
2015-01-12 17:03:47 +00:00
|
|
|
url(r"^opds/(?P<facet>.*)/$", OPDSAcquisitionView.as_view(), name="opds_acqusition"),
|
2017-02-11 20:58:54 +00:00
|
|
|
url(r"^opdsjson/(?P<facet>.*)/$", OPDSAcquisitionView.as_view(json=True), name="opdsjson_acqusition"),
|
2015-08-27 01:35:29 +00:00
|
|
|
url(r"^onix/(?P<facet>.*)/$", OnixView.as_view(), name="onix"),
|
2015-08-28 20:20:46 +00:00
|
|
|
url(r"^onix/$", OnixView.as_view(), name="onix_all"),
|
2016-07-27 17:02:47 +00:00
|
|
|
url(r'^id/work/(?P<work_id>\w+)/$', negotiate_content, name="work_identifier"),
|
2018-04-19 17:18:06 +00:00
|
|
|
url(r'^loader/yaml$', load_yaml, name="load_yaml"),
|
|
|
|
url(r'^travisci/webhook$', travisci_webhook, name="travisci_webhook"),
|
2016-07-27 17:02:47 +00:00
|
|
|
url(r'^', include(v1_api.urls)),
|
|
|
|
]
|