submissions.mixins module

class submissions.mixins.FriendlyPermissionMixin[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin

This mixin controls the permissions with a fallback for anonymous users to help them login first. If a logged in user is refused, they will get the http 403 screen anyway.

Permission_required

The permission code the user should comply with.

permission_required = 'scipost.dummy_permission'
dispatch(request, *args, **kwargs)[source]
class submissions.mixins.SubmissionMixin[source]

Bases: object

Provides submission as self.submission for get, post and in context.

get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
get_context_data(*args, **kwargs)[source]
class submissions.mixins.SubmissionFormViewMixin[source]

Bases: object

get_success_url()[source]
get_form_kwargs()[source]

Ideally all ModelForms on Submission-related objects have a required argument submission.

class submissions.mixins.SubmissionAdminViewMixin[source]

Bases: submissions.mixins.FriendlyPermissionMixin, submissions.mixins.SubmissionFormViewMixin

This mixin will provide all basic methods and checks required for Submission administration actions regarding Submissions.

Editorial_page

Submission is element of the set pool() if False, else Submission is element of the subset: editorial_page()

editorial_page = False
slug_field = 'preprint__identifier_w_vn_nr'
slug_url_kwarg = 'identifier_w_vn_nr'
property pool
get_queryset()[source]

Return either of two sets of Submissions, with an author filter for the current user.

This method is used in all Class-Based-Views. However, if one overwrites either one of the
  • get_object()

  • get_queryset()

methods, please don’t forget to call super().method_name() to not remove this filter!

get_object()[source]

Save the original Submission instance for performance reasons to the view, which may be used in get_context_data().

get_context_data(*args, **kwargs)[source]

If the main object in a DetailView is not a Submission instance, it will be lost. Here, explicitly save the Submission instance to the context data.