Project

Profile

Help

Story #7191

closed

As a plugin writer, I want to have an immutable RepositoryViewSet

Added by lmjachky over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Create a new ViewSet class similar to RepositoryViewSet that will be immutable.

class ImmutableRepositoryViewSet(
    NamedModelViewSet,
    mixins.CreateModelMixin,
    mixins.RetrieveModelMixin,
    mixins.ListModelMixin,
    AsyncRemoveMixin,
):
    """
    A repository ViewSet that does not allow the usage of the methods PATCH and PUT.
    """

    queryset = Repository.objects.all().order_by("name")
    serializer_class = RepositorySerializer
    endpoint_name = "repositories"
    router_lookup = "repository"
    filterset_class = RepositoryFilter

Also available in: Atom PDF