api.v1 package¶
The original version of the API.
Deprecated since version 0.7.4: Use api.v2
instead.
Submodules¶
api.v1.apps module¶
App configuration.
-
class
api.v1.apps.
ApiV1Config
(app_name, app_module)[source]¶ Bases:
django.apps.AppConfig
Configuration for the api.v1 app.
api.v1.response module¶
Convenience classes and functions for API responses.
-
api.v1.response.
require_methods_api
(allowed_methods=('GET', 'HEAD'))[source]¶ - Decorator to make an API view only accept particular request methods.Based on
django.views.decorators.http.require_http_request()
.
-
class
api.v1.response.
JsonError
(message, status=500, **kwargs)[source]¶ Bases:
django.http.JsonResponse
A JSON-formatted error response.
Deprecated since version 0.7.4: Use
JsonResponse({'error': ...}, status=...)
instead
api.v1.urls module¶
The URLconf of the api.v1 app.
-
api.v1.urls.
app_name
= 'v1'¶ The URL namespace of the api.v1 app.
-
api.v1.urls.
urlpatterns
= [<URLPattern 'releases/' [name='releases']>, <URLPattern 'series/' [name='all_series']>, <URLPattern 'series/<slug:slug>/' [name='series']>, <URLPattern 'series/<slug:slug>/<int:vol>/' [name='volume']>, <URLPattern 'series/<slug:slug>/<int:vol>/<float:num>/' [name='chapter']>, <URLPattern 'authors/' [name='all_authors']>, <URLPattern 'authors/<int:p_id>/' [name='author']>, <URLPattern 'artists/' [name='all_artists']>, <URLPattern 'artists/<int:p_id>/' [name='artist']>, <URLPattern 'groups/' [name='all_groups']>, <URLPattern 'groups/<int:g_id>/' [name='group']>, <URLPattern 'categories/' [name='categories']>]¶ The URL patterns of the api.v1 app.
api.v1.views module¶
The views of the api.v1 app.
-
api.v1.views.
all_releases
(request)[source]¶ View that serves all the releases in a JSON array.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A JSON-formatted response with the releases.
-
api.v1.views.
all_series
(request)[source]¶ View that serves all the series in a JSON array.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A JSON-formatted response with the series.
-
api.v1.views.
series
(request, slug)[source]¶ View that serves a single series as a JSON object.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.
- Return type
- Returns
A JSON-formatted response with the series.
-
api.v1.views.
volume
(request, slug, vol)[source]¶ View that serves a single volume as a JSON object.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.vol (
int
) – The number of the volume.
- Return type
- Returns
A JSON-formatted response with the volume.
-
api.v1.views.
chapter
(request, slug, vol, num)[source]¶ View that serves a single chapter as a JSON object.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.vol (
int
) – The number of the volume.num (
float
) – The number of the chapter.
- Return type
- Returns
A JSON-formatted response with the chapter.
-
api.v1.views.
all_people
(request)[source]¶ View that serves all the authors/artists in a JSON array.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A JSON-formatted response with the authors/artists.
-
api.v1.views.
person
(request, p_id)[source]¶ View that serves a single author/artist as a JSON object.
- Parameters
request (
HttpRequest
) – The original request.p_id (
int
) – The ID of the author/artist.
- Return type
- Returns
A JSON-formatted response with the author/artist.
-
api.v1.views.
all_groups
(request)[source]¶ View that serves all the groups in a JSON array.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A JSON-formatted response with the groups.
-
api.v1.views.
group
(request, g_id)[source]¶ View that serves a single group as a JSON object.
- Parameters
request (
HttpRequest
) – The original request.g_id (
int
) – The ID of the group.
- Return type
- Returns
A JSON-formatted response with the group.
-
api.v1.views.
categories
(request)[source]¶ View that serves all the categories in a JSON array.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A JSON-formatted response with the categories.