reader package¶
The app that handles configuration.
Submodules¶
reader.admin module¶
Admin models for the reader app.
- reader.admin.alias_inline(model)[source]¶
Get an inline admin model for
Alias
.- Parameters
model (
str
) – The name of the model that holds the alias.- Return type
- class reader.admin.ChapterAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.ModelAdmin
Admin model for
Chapter
.- inlines = (<class 'reader.admin.PageInline'>,)¶
- date_hierarchy = 'published'¶
- list_display = ('preview', 'title', 'series', 'volume', '_number', 'published', 'modified', 'views', 'final')¶
- list_display_links = ('title',)¶
- ordering = ('-modified',)¶
- sortable_by = ('title', 'series', 'volume', 'number', 'published', 'modified', 'views')¶
- search_fields = ('title', 'series__title')¶
- list_filter = (('series', <class 'django.contrib.admin.filters.RelatedFieldListFilter'>), ('groups', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>), <class 'MangAdventure.filters.boolean_filter.<locals>._BooleanFilter'>, ('published', <class 'reader.admin.DateFilter'>), ('series__manager', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>))¶
- actions = ('toggle_final',)¶
- empty_value_display = 'N/A'¶
- toggle_final(request, queryset)[source]¶
Toggle the status of the selected chapters.
- Parameters
request (
HttpRequest
) – The original request.queryset (
QuerySet
) – The original queryset.
- get_form(request, obj, **kwargs)[source]¶
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- Parameters
request (
HttpRequest
) –
- Return type
- has_change_permission(request, obj=None)[source]¶
Return
True
if editing the object is permitted.Superusers can edit any chapter.Scanlators can only edit chapters of series they manage.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
True
if the user is allowed to edit the chapter.
- has_delete_permission(request, obj=None)[source]¶
Return
True
if deleting the object is permitted.Superusers delete edit any chapter.Scanlators can only delete chapters of series they manage.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
True
if the user is allowed to delete the chapter.
- class reader.admin.SeriesAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.ModelAdmin
Admin model for
Series
.- inlines = (<class 'reader.admin.alias_inline.<locals>._AliasInline'>,)¶
- list_display = ('cover_image', 'title', 'manager', 'created', 'modified', 'views', 'completed', 'licensed')¶
- list_display_links = ('title',)¶
- date_hierarchy = 'created'¶
- ordering = ('-modified',)¶
- sortable_by = ('title', 'created', 'modified', 'views')¶
- search_fields = ('title', 'aliases__name')¶
- autocomplete_fields = ('categories',)¶
- list_filter = (('authors', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>), ('artists', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>), ('categories', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>), <class 'MangAdventure.filters.boolean_filter.<locals>._BooleanFilter'>, ('manager', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>))¶
- actions = ('toggle_completed', 'toggle_licensed')¶
- empty_value_display = 'N/A'¶
- get_form(request, obj=None, change=False, **kwargs)[source]¶
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_queryset(request)[source]¶
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- Parameters
request (
HttpRequest
) –- Return type
- toggle_completed(request, queryset)[source]¶
Toggle the publication status of the selected series.
- Parameters
request (
HttpRequest
) – The original request.queryset (
QuerySet
) – The original queryset.
- toggle_licensed(request, queryset)[source]¶
Toggle the licensing status of the selected series.
- Parameters
request (
HttpRequest
) – The original request.queryset (
QuerySet
) – The original queryset.
- has_change_permission(request, obj=None)[source]¶
Return
True
if editing the object is permitted.Superusers can edit any series.Scanlators can only edit series they manage.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
True
if the user is allowed to edit the series.
- has_delete_permission(request, obj=None)[source]¶
Return
True
if deleting the object is permitted.Superusers can delete any series.Scanlators can only delete series they manage.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
True
if the user is allowed to delete the series.
- class reader.admin.AuthorAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.ModelAdmin
Admin model for
Author
.- inlines = (<class 'reader.admin.alias_inline.<locals>._AliasInline'>,)¶
- list_display = ('name', 'aliases')¶
- search_fields = ('name', 'aliases__name')¶
- class reader.admin.ArtistAdmin(*args, **kwargs)[source]¶
Bases:
django.contrib.admin.ModelAdmin
Admin model for
Artist
.- inlines = (<class 'reader.admin.alias_inline.<locals>._AliasInline'>,)¶
- exclude = ('aliases',)¶
- list_display = ('name', 'aliases')¶
- search_fields = ('name', 'aliases__name')¶
- class reader.admin.CategoryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.ModelAdmin
Admin model for
Category
.- exclude = ('id',)¶
- ordering = ('id',)¶
- sortable_by = ()¶
- list_display = ('name', 'description')¶
- search_fields = ('name', 'description')¶
- get_readonly_fields(request, obj=None)[source]¶
Return the fields that cannot be changed.
Once a
Category
object has been created, itsname
cannot be altered.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
A tuple of readonly fields.
reader.api module¶
API viewsets for the reader app.
- class reader.api.ArtistViewSet(**kwargs)[source]¶
Bases:
api.v2.mixins.CORSMixin
,rest_framework.viewsets.ModelViewSet
API endpoints for artists.
list: List artists.
read: View a certain artist.
create: Create a new artist.
update: Update the given artist.
patch: Edit the given artist.
delete: Delete the given artist.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- queryset = QuerySet¶
- serializer_class¶
alias of
reader.serializers.ArtistSerializer
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.AuthorViewSet(**kwargs)[source]¶
Bases:
api.v2.mixins.CORSMixin
,rest_framework.viewsets.ModelViewSet
API endpoints for authors.
list: List authors.
read: View a certain author.
create: Create a new author.
update: Update the given author.
patch: Edit the given author.
delete: Delete the given author.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- queryset = QuerySet¶
- serializer_class¶
alias of
reader.serializers.AuthorSerializer
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.CategoryViewSet(**kwargs)[source]¶
Bases:
api.v2.mixins.CORSMixin
,rest_framework.viewsets.ModelViewSet
API endpoints for categories.
list: List categories.
read: View a certain category.
create: Create a new category.
patch: Edit the given category.
delete: Delete the given category.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- http_method_names = ['get', 'post', 'patch', 'delete', 'head', 'options']¶
- serializer_class¶
- queryset = QuerySet¶
- lookup_field = 'name'¶
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.PageViewSet(**kwargs)[source]¶
Bases:
rest_framework.mixins.CreateModelMixin
,rest_framework.mixins.DestroyModelMixin
,rest_framework.mixins.ListModelMixin
,rest_framework.mixins.UpdateModelMixin
,api.v2.mixins.CORSMixin
,rest_framework.viewsets.GenericViewSet
API endpoints for pages.
list: List a chapter’s pages.
create: Create a new page.
update: Update the given page.
patch: Edit the given page.
delete: Delete the given page.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- queryset = QuerySet¶
- serializer_class¶
alias of
reader.serializers.PageSerializer
- filter_backends = [<class 'reader.filters.PageFilter'>]¶
- parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)¶
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.ChapterViewSet(**kwargs)[source]¶
Bases:
api.v2.mixins.CORSMixin
,rest_framework.viewsets.ModelViewSet
API endpoints for chapters.
list: List chapters.
read: View a certain chapter.
create: Create a new chapter.
update: Update the given chapter.
patch: Edit the given chapter.
delete: Delete the given chapter.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- serializer_class¶
alias of
reader.serializers.ChapterSerializer
- filter_backends = [<class 'reader.filters.ChapterFilter'>, <class 'reader.filters.DateFormat'>]¶
- parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)¶
- get_queryset()[source]¶
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- Return type
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.SeriesViewSet(**kwargs)[source]¶
Bases:
api.v2.mixins.CORSMixin
,rest_framework.viewsets.ModelViewSet
API endpoints for series.
list: List or search for series.
read: View the details of a series.
create: Create a new series.
update: Update the given series.
patch: Edit the given series.
delete: Delete the given series.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- filter_backends = [<class 'reader.filters.TitleFilter'>, <class 'reader.filters.AuthorFilter'>, <class 'reader.filters.ArtistFilter'>, <class 'reader.filters.StatusFilter'>, <class 'reader.filters.CategoriesFilter'>, <class 'reader.filters.SlugFilter'>, <class 'reader.filters.SeriesSort'>]¶
- parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)¶
- pagination_class¶
- ordering = ('title',)¶
- lookup_field = 'slug'¶
- get_queryset()[source]¶
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- Return type
- get_serializer_class()[source]¶
Return the class to use for the serializer. Defaults to using self.serializer_class.
You may want to override this if you need to provide different serializations depending on the incoming request.
(Eg. admins get full serialization, others get basic serialization)
- Return type
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
- class reader.api.CubariViewSet(**kwargs)[source]¶
Bases:
rest_framework.mixins.RetrieveModelMixin
,api.v2.mixins.CORSMixin
,rest_framework.viewsets.GenericViewSet
API endpoints for Cubari.
read: Generate JSON for cubari.moe.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- serializer_class¶
alias of
reader.serializers.CubariSerializer
- lookup_field = 'slug'¶
- get_queryset()[source]¶
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- Return type
- basename = None¶
- description = None¶
- detail = None¶
- name = None¶
- suffix = None¶
reader.apps module¶
App configuration.
reader.feeds module¶
RSS and Atom feeds for the reader app.
- class reader.feeds.LibraryRSS[source]¶
Bases:
django.contrib.syndication.views.Feed
RSS feed for the series library.
- ttl = 600¶
- link = '/reader/'¶
- description = 'Updates when a new series is added'¶
- author_name = 'MangAdventure'¶
- title = 'Library - MangAdventure'¶
- item_guid_is_permalink = True¶
- class reader.feeds.LibraryAtom[source]¶
Bases:
reader.feeds.LibraryRSS
Atom feed for the series library.
- feed_type¶
alias of
django.utils.feedgenerator.Atom1Feed
- subtitle = 'Updates when a new series is added'¶
- class reader.feeds.ReleasesRSS[source]¶
Bases:
django.contrib.syndication.views.Feed
RSS feed for chapter releases.
- ttl = 600¶
- author_name = 'MangAdventure'¶
- item_guid_is_permalink = True¶
- get_object(request, slug=None)[source]¶
Get a
Series
object from the request.- Parameters
request (
HttpRequest
) – The original request.
- Return type
- Returns
The series that has the given slug, or
None
if the slug isNone
.
- class reader.feeds.ReleasesAtom[source]¶
Bases:
reader.feeds.ReleasesRSS
Atom feed for chapter releases.
- feed_type¶
alias of
django.utils.feedgenerator.Atom1Feed
reader.filters module¶
Custom filter backends for the API.
- reader.filters.SERIES_FILTERS = [<class 'reader.filters.TitleFilter'>, <class 'reader.filters.AuthorFilter'>, <class 'reader.filters.ArtistFilter'>, <class 'reader.filters.StatusFilter'>, <class 'reader.filters.CategoriesFilter'>, <class 'reader.filters.SlugFilter'>, <class 'reader.filters.SeriesSort'>]¶
The filters used in the series endpoint.
- reader.filters.CHAPTER_FILTERS = [<class 'reader.filters.ChapterFilter'>, <class 'reader.filters.DateFormat'>]¶
The filters used in the chapters endpoint.
- reader.filters.PAGE_FILTERS = [<class 'reader.filters.PageFilter'>]¶
The filters used in the pages endpoint.
reader.models module¶
Database models for the reader app.
- class reader.models.Author(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A model representing an author.
- __str__()[source]¶
Return a string representing the object.
- Return type
- Returns
The name of the author.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Artist(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A model representing an artist.
- __str__()[source]¶
Return a string representing the object.
- Return type
- Returns
The name of the artist.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Series(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
- cover¶
ImageField
– The cover image of the series.
- completed¶
BooleanField
– The publication status of the series.
- licensed¶
BooleanField
– The licensing status of the series.
- created¶
DateTimeField
– The date the series was created.
- modified¶
DateTimeField
– The modification date of the series.
- manager¶
ForeignKey
– The person who manages this series.
- get_absolute_url()[source]¶
Get the absolute URL of the object.
- Return type
- Returns
The URL of
reader.views.series()
.
- get_directory()[source]¶
Get the storage directory of the object.
- Return type
- Returns
A path relative to
MEDIA_ROOT
.
- __str__()[source]¶
Return a string representing the object.
- Return type
- Returns
The title of the series.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Chapter(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A model representing a chapter.
- number¶
FloatField
– The number of the chapter.
- volume¶
_NonZeroIntegerField
– The volume of the chapter.
- series¶
ForeignKey
– The series this chapter belongs to.
- final¶
BooleanField
– The status of the chapter.
- published¶
DateTimeField
– The publication date of the chapter.
- modified¶
DateTimeField
– The modification date of the chapter.
- views¶
PositiveIntegerField
– The total views of the chapter.
- classmethod track_view(**kwargs)[source]¶
Increment the chapter views in a new thread.
- Parameters
kwargs – The arguments given to the queryset filter.
- get_absolute_url()[source]¶
Get the absolute URL of the object.
- Return type
- Returns
The URL of
reader.views.chapter_redirect()
.
- get_directory()[source]¶
Get the storage directory of the object.
- Return type
- Returns
A path relative to
MEDIA_ROOT
.
- zip()[source]¶
Generate a zip file containing the pages of this chapter.
- Return type
- Returns
The file-like object of the generated file.
- __eq__(other)[source]¶
Check whether this object is equal to another.
If the other object is a tuple, the objects are equal if the tuple consists of the volume and number of the chapter.
Otherwise, the objects are equal if they have the same base model and their primary keys are equal.
- __gt__(other)[source]¶
Check whether this object is greater than another.
If the other object is a tuple, this object is greater if its volume and number is greater than the tuple.
Otherwise, it’s greater if the objects have the same base model and the tuple of its
volume
andnumber
is greater than the other’s.
- __lt__(other)[source]¶
Check whether this object is less than another.
If the other object is a tuple, this object is lesser if its volume and number is less than the tuple.
Otherwise, it’s lesser if the objects have the same base model and the tuple of its
volume
andnumber
is less than the other’s.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)¶
- get_next_by_published(*, field=<django.db.models.fields.DateTimeField: published>, is_next=True, **kwargs)¶
- get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)¶
- get_previous_by_published(*, field=<django.db.models.fields.DateTimeField: published>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Page(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A model representing a page.
- chapter¶
ForeignKey
– The chapter this page belongs to.
- image¶
ImageField
– The image of the page.
- number¶
_NonZeroIntegerField
– The number of the page.
- get_absolute_url()[source]¶
Get the absolute URL of the object.
- Return type
- Returns
The URL of
reader.views.chapter_page()
.
- __str__()[source]¶
Return a string representing the object.
- Return type
- Returns
The title of the series, the volume, number, title of the chapter, and the file name of the page.
- __eq__(other)[source]¶
Check whether this object is equal to another.
If the other object is a number, the objects are equal if the
number
of this object is equal to the other object.Otherwise, the objects are equal if they have the same base model and their
chapter
andnumber
are respectively equal.
- __gt__(other)[source]¶
Check whether this object is greater than another.
If the other object is a number, this object is greater if its
number
is greater than the other object.Otherwise, it’s greater if the objects have the same base model and the
number
of this object is greater than the other’s.
- __lt__(other)[source]¶
Check whether this object is less than another.
If the other object is a number, this object is lesser if its
number
is less than the other object.Otherwise, it’s lesser if the objects have the same base model and the
number
of this object is less than the other’s.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Category(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A model representing a category.
- __str__()[source]¶
Return a string representing the object.
- Return type
- Returns
The name of the category.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- objects = <django.db.models.manager.Manager object>¶
- class reader.models.Alias(*args, **kwargs)[source]¶
Bases:
django.db.models.Model
A generic alias
Model
.- name¶
CharField
– A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- object_id¶
PositiveIntegerField
– A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- content_type¶
ForeignKey
– Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- content_object¶
GenericForeignKey
– Provide a generic many-to-one relation through thecontent_type
andobject_id
fields.This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.
- objects = <reader.models.AliasManager object>¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
reader.receivers module¶
Signal receivers for the reader app.
- reader.receivers.redirect_series(sender, instance, **kwargs)[source]¶
Receive a signal when a series is about to be saved.
If the series exists and its slug has changed, rename its directory and create a new
Redirect
.
reader.serializers module¶
Model serializers for the reader app.
- class reader.serializers.ArtistSerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
Serializer for artists.
- class reader.serializers.AuthorSerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
Serializer for authors.
- class reader.serializers.CategorySerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
Serializer for categories.
- class reader.serializers.ChapterSerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
Serializer for chapters.
- class reader.serializers.PageSerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
Serializer for chapter pages.
- class Meta[source]¶
Bases:
object
- model¶
alias of
reader.models.Page
- fields = ('id', 'chapter', 'image', 'number', 'url')¶
- extra_kwargs = {'image': {'help_text': 'The image of the page.'}, 'number': {'help_text': 'The number of the page.'}}¶
- validators = (<UniqueTogetherValidator(queryset=QuerySet, fields=('chapter', 'number'))>,)¶
- class reader.serializers.SeriesSerializer(*args, **kwds)[source]¶
Bases:
Generic
[reader.serializers.TSeriesSerializer
]Generic series serializer.
- __orig_bases__ = (typing.Generic[~TSeriesSerializer],)¶
- __parameters__ = (~TSeriesSerializer,)¶
reader.sitemaps module¶
Sitemaps for the reader app.
- class reader.sitemaps.SeriesSitemap[source]¶
Bases:
django.contrib.sitemaps.Sitemap
Sitemap for series.
- class reader.sitemaps.ChapterSitemap[source]¶
Bases:
django.contrib.sitemaps.Sitemap
Sitemap for chapters.
reader.urls module¶
The URLconf of the reader app.
- reader.urls.app_name = 'reader'¶
The URL namespace of the reader app.
- reader.urls.urlpatterns = [<URLPattern '' [name='directory']>, <URLPattern '<slug:slug>/' [name='series']>, <URLPattern '<slug:slug>/<int:vol>/<float:num>/' [name='chapter']>, <URLPattern '<slug:slug>/<int:vol>/<float:num>/<int:page>/' [name='page']>, <URLPattern '<slug:slug>.atom' [name='series.atom']>, <URLPattern '<slug:slug>.rss' [name='series.rss']>, <URLPattern '<section>-sitemap.xml' [name='sitemap.xml']>, <URLPattern '<slug:slug>/<int:vol>/<float:num>.cbz' [name='cbz']>]¶
The URL namespace of the reader app.
reader.views module¶
The views of the reader app.
- reader.views.directory(request)[source]¶
View that serves a page which lists all the series.
- Parameters
request (
HttpRequest
) – The original request.- Return type
- Returns
A response with the rendered
all_series.html
template.
- reader.views.series(request, slug)[source]¶
View that serves the page of a single series.
If the series doesn’t have any published chapters, only staff members will be able to see it.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.
- Return type
- Returns
A response with the rendered
series.html
template.- Raises
Http404 – If there is no series with the specified
slug
.
- reader.views.chapter_page(request, slug, vol, num, page)[source]¶
View that serves a chapter page.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.vol (
int
) – The volume of the chapter.num (
float
) – The number of the chapter.page (
int
) – The number of the page.
- Return type
- Returns
A response with the rendered
chapter.html
template.- Raises
Http404 – If there is no matching chapter or page.
- reader.views.chapter_redirect(request, slug, vol, num)[source]¶
View that redirects a chapter to its first page.
- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the series.vol (
int
) – The volume of the chapter.num (
float
) – The number of the chapter.
- Return type
- Returns
A redirect to
chapter_page()
.
- reader.views.chapter_download(request, slug, vol, num)[source]¶
View that generates a
.cbz
file from a chapter.- Parameters
request (
HttpRequest
) – The original request.slug (
str
) – The slug of the chapter’s series.vol (
int
) – The volume of the chapter.num (
float
) – The number of the chapter.
- Return type
- Returns
A response with the
.cbz
file if the user is logged in.- Raises
Http404 – If the chapter does not exist.