groups package¶
The app that handles groups.
Subpackages¶
Submodules¶
groups.admin module¶
Admin models for the groups app.
- class groups.admin.MemberRoleInline(parent_model, admin_site)[source]¶
Bases:
StackedInline
Inline admin model for
Role
.- extra = 1¶
- get_formset(request, obj, **kwargs)[source]¶
Return a BaseInlineFormSet class for use in admin add/change views.
- Parameters:
request (
HttpRequest
) –
- Return type:
- class groups.admin.MemberAdmin(model, admin_site)[source]¶
Bases:
ModelAdmin
Admin model for
Member
.- inlines = (<class 'groups.admin.MemberRoleInline'>,)¶
- ordering = [Lower(F(name))]¶
- sortable_by = ('name',)¶
- list_display = ('name', '_twitter', 'discord', 'irc', '_reddit')¶
- search_fields = ('name', 'twitter', 'discord', 'irc', 'reddit')¶
- list_filter = (('roles__group__name', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>), ('roles__role', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>))¶
- class groups.admin.GroupAdmin(model, admin_site)[source]¶
Bases:
ModelAdmin
Admin model for
Group
.- exclude = ('id',)¶
- ordering = [Lower(F(name))]¶
- sortable_by = ('name',)¶
- list_display = ('image', 'name', '_website', 'manager', 'description')¶
- search_fields = ('name', 'website', 'description')¶
- list_display_links = ('name',)¶
- list_filter = (('manager', <class 'MangAdventure.filters.title_filter.<locals>._GenericFilter'>),)¶
- 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.
- has_change_permission(request, obj=None)[source]¶
Return
True
if editing the object is permitted.Superusers can edit any group.Scanlators can only edit groups they manage.- Parameters:
request (
HttpRequest
) – The original request.
- Return type:
- Returns:
True
if the user is allowed to edit the group.
- has_delete_permission(request, obj=None)[source]¶
Return
True
if deleting the object is permitted.Superusers can delete any group.Scanlators can only delete groups they manage.- Parameters:
request (
HttpRequest
) – The original request.
- Return type:
- Returns:
True
if the user is allowed to delete the group.
groups.api module¶
API viewsets for the groups app.
- class groups.api.GroupViewSet(**kwargs)[source]¶
Bases:
CORSMixin
,ModelViewSet
API endpoints for groups.
list: List groups.
read: View a certain group.
create: Create a new group.
patch: Edit the given group.
delete: Delete the given group.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- queryset = QuerySet¶
- serializer_class¶
alias of
GroupSerializer
- parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)¶
- http_method_names = ['get', 'post', 'patch', 'delete', 'head', 'options']¶
- basename = None¶
- description = None¶
- detail = None¶
- dispatch(request, *args, **kwargs)¶
.dispatch() is pretty much the same as Django’s regular dispatch, but with extra hooks for startup, finalize, and exception handling.
- name = None¶
- suffix = None¶
- class groups.api.MemberViewSet(**kwargs)[source]¶
Bases:
CORSMixin
,ModelViewSet
API endpoints for members.
list: List members.
read: View a certain member.
create: Create a new member.
patch: Edit the given member.
delete: Delete the given member.
- schema¶
OpenAPISchema
– Custom OpenAPI schema class.
- queryset = QuerySet¶
- serializer_class¶
alias of
MemberSerializer
- parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)¶
- http_method_names = ['get', 'post', 'patch', 'delete', 'head', 'options']¶
- basename = None¶
- description = None¶
- detail = None¶
- dispatch(request, *args, **kwargs)¶
.dispatch() is pretty much the same as Django’s regular dispatch, but with extra hooks for startup, finalize, and exception handling.
- name = None¶
- suffix = None¶
groups.apps module¶
App configuration.
groups.feeds module¶
RSS and Atom feeds for the groups app.
- class groups.feeds.GroupRSS[source]¶
Bases:
Feed
RSS feed for a group’s releases.
- ttl = 600¶
- author_name = 'MangAdventure'¶
- item_guid_is_permalink = True¶
- get_object(request, g_id)[source]¶
Get a
Group
object from the request.- Parameters:
request (
HttpRequest
) – The original request.g_id (
int
) – The id of the group.
- Return type:
- Returns:
The group that has the given id.
- __call__(request, *args, **kwargs)¶
Call self as a function.
groups.models module¶
Database models for the groups app.
- class groups.models.Group(*args, **kwargs)[source]¶
Bases:
Model
A model representing a group.
- email¶
EmailField
– The group’s e-mail address.
- discord¶
DiscordURLField
– The Discord server URL of the group.
- twitter¶
TwitterField
– The Twitter username of the group.
- reddit¶
RedditField
– The Reddit username or subreddit name of the group.
- logo¶
ImageField
– The group’s logo.
- manager¶
ForeignKey
– The person who manages this group.
- get_absolute_url()[source]¶
Get the absolute URL of the object.
- Return type:
- Returns:
The URL of
groups.views.group()
.
- 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 name of the group.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- objects = <django.db.models.manager.Manager object>¶
- class groups.models.Member(*args, **kwargs)[source]¶
Bases:
Model
A model representing a member.
- twitter¶
TwitterField
– The member’s Twitter username.
- discord¶
DiscordNameField
– The member’s Discord username and discriminator.
- reddit¶
RedditField
– The member’s Reddit username.
- __str__()[source]¶
Return a string representing the object.
- Return type:
- Returns:
The name of the member.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- objects = <django.db.models.manager.Manager object>¶
- class groups.models.Role(*args, **kwargs)[source]¶
Bases:
Model
A model representing a role.
- class Choices(value)[source]¶
Bases:
TextChoices
The possible role choices.
- LD = 'LD'¶
- TL = 'TL'¶
- PR = 'PR'¶
- CL = 'CL'¶
- RD = 'RD'¶
- TS = 'TS'¶
- RP = 'RP'¶
- QC = 'QC'¶
- member¶
ForeignKey
– The member this role belongs to.
- group¶
ForeignKey
– The group this role belongs to.
- __str__()[source]¶
Return a string representing the object.
- Return type:
- Returns:
The name and group of the role.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- get_role_display(*, field=<django.db.models.CharField: role>)¶
- objects = <django.db.models.manager.Manager object>¶
groups.serializers module¶
Model serializers for the groups app.
groups.sitemaps module¶
Sitemaps for the groups app.
groups.urls module¶
The URLconf of the groups app.
- groups.urls.app_name = 'groups'¶
The URL namespace of the groups app.
- groups.urls.urlpatterns = [<URLPattern '' [name='all_groups']>, <URLPattern '<int:g_id>/' [name='group']>, <URLPattern '<int:g_id>.atom' [name='group.atom']>, <URLPattern '<int:g_id>.rss' [name='group.rss']>, <URLPattern '<section>-sitemap.xml' [name='sitemap.xml']>]¶
The URL patterns of the groups app.
groups.views module¶
The views of the users app.
- groups.views.all_groups(request)[source]¶
View that serves a page with all the groups.
- Parameters:
request (
HttpRequest
) – The original request.- Return type:
- Returns:
A response with the rendered
all_groups.html
template.
- groups.views.group(request, g_id)[source]¶
View that serves a single group’s page.
- Parameters:
request (
HttpRequest
) – The original request.g_id (
int
) – The ID of the group.
- Return type:
- Returns:
A response with the rendered
group.html
template.- Raises:
Http404 – If the group does not exist.