reader package¶
The app that handles configuration.
-
reader.
default_app_config
= 'reader.apps.ReaderConfig'¶ The config class of the app.
Submodules¶
reader.admin module¶
Admin models for the reader app.
-
class
reader.admin.
SeriesAliasInline
(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.StackedInline
Inline admin model for
SeriesAlias
.-
model
¶ alias of
reader.models.SeriesAlias
-
extra
= 1¶
-
-
class
reader.admin.
AuthorAliasInline
(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.StackedInline
Inline admin model for
AuthorAlias
.-
model
¶ alias of
reader.models.AuthorAlias
-
extra
= 1¶
-
-
class
reader.admin.
ArtistAliasInline
(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.StackedInline
Inline admin model for
ArtistAlias
.-
model
¶ alias of
reader.models.ArtistAlias
-
extra
= 1¶
-
-
class
reader.admin.
ChapterAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Admin model for
Chapter
.-
inlines
= (<class 'reader.admin.PageInline'>,)¶
-
date_hierarchy
= 'published'¶
-
list_display
= ('preview', 'title', 'volume', '_number', 'published', 'modified', 'final')¶
-
list_display_links
= ('title',)¶
-
ordering
= ('-modified',)¶
-
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'>))¶
-
actions
= ('toggle_final',)¶
-
empty_value_display
= 'N/A'¶
-
-
class
reader.admin.
SeriesAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Admin model for
Series
.-
form
¶ alias of
SeriesForm
-
inlines
= (<class 'reader.admin.SeriesAliasInline'>,)¶
-
list_display
= ('cover_image', 'title', 'created', 'modified', 'completed')¶
-
list_display_links
= ('title',)¶
-
date_hierarchy
= 'created'¶
-
ordering
= ('-modified',)¶
-
search_fields
= ('title',)¶
-
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'>)¶
-
actions
= ('toggle_completed',)¶
-
empty_value_display
= 'N/A'¶
-
-
class
reader.admin.
AuthorAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Admin model for
Author
.-
inlines
= (<class 'reader.admin.AuthorAliasInline'>,)¶
-
list_display
= ('name', 'aliases')¶
-
search_fields
= ('name', 'aliases__alias')¶
-
-
class
reader.admin.
ArtistAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Admin model for
Artist
.-
inlines
= (<class 'reader.admin.ArtistAliasInline'>,)¶
-
list_display
= ('name', 'aliases')¶
-
search_fields
= ('name', 'aliases__alias')¶
-
-
class
reader.admin.
CategoryAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Admin model for
Category
.-
exclude
= ('id',)¶
-
list_display
= ('name', 'description')¶
-
search_fields
= ('name', 'description')¶
-
reader.apps module¶
App configuration.
reader.feeds module¶
-
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'¶
-
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¶
-
item_guid_is_permalink
= True¶
-
-
class
reader.feeds.
ReleasesAtom
[source]¶ Bases:
reader.feeds.ReleasesRSS
Atom feed for chapter releases.
-
feed_type
¶ alias of
django.utils.feedgenerator.Atom1Feed
-
reader.models module¶
Database models for the reader app.
-
class
reader.models.
Author
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.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.
AuthorAlias
(*args, **kwargs)[source]¶ Bases:
MangAdventure.models.Alias
A model representing an author’s alias.
AliasKeyField
– The author this alias belongs to.
-
alias
: MangAdventure.models.AliasField¶ AliasField
– The alias of the author.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
class
reader.models.
Artist
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.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.
ArtistAlias
(*args, **kwargs)[source]¶ Bases:
MangAdventure.models.Alias
A model representing an author’s alias.
-
artist
¶ AliasKeyField
– The artist this alias belongs to.
-
alias
: MangAdventure.models.AliasField¶ AliasField
– The alias of the artist.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
-
class
reader.models.
Series
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
-
cover
¶ ImageField
– The cover image of the series.
-
completed
¶ BooleanField
– The status of the series.
-
created
¶ DateTimeField
– The date the series was created.
-
modified
¶ DateTimeField
– The modification date of the 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.
SeriesAlias
(*args, **kwargs)[source]¶ Bases:
MangAdventure.models.Alias
A model representing a series’ alias.
-
series
¶ AliasKeyField
– The series this alias belongs to.
-
alias
: MangAdventure.models.AliasField¶ AliasField
– The alias of the series.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
-
class
reader.models.
Chapter
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A model representing a chapter.
-
number
¶ FloatField
– The number of the chapter.
-
volume
¶ PositiveSmallIntegerField
– 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.
-
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
BytesIO
- 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.- Parameters
other – Any other object.
- Returns
True
if this object is lesser.- Raises
TypeError – If the other object is neither a tuple, nor a
Chapter
model.
-
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.base.Model
A model representing a page.
-
chapter
¶ ForeignKey
– The chapter this page belongs to.
-
image
¶ ImageField
– The image of the page.
-
number
¶ _PageNumberField
– 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()
.
-
property
preload
¶ QuerySet
– Get the pages that will be preloaded.TODO
Make the number of preloaded pages configurable.
- Returns
The three next pages of the chapter.
-
__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.base.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>¶
-
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.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 '<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
HttpResponse
- 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
HttpResponse
- 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
- Return type
HttpResponse
- 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
- Return type
HttpResponsePermanentRedirect
- Returns
A redirect to
chapter_page()
.