<commit_before>from rest_framework import mixins
from rest_framework import viewsets

from adhocracy4.api.mixins import AllowPUTAsCreateMixin
from adhocracy4.api.permissions import IsModerator

from .models import ModeratorRemark
from .serializers import ModeratorRemarkSerializer


class ModeratorRemarkViewSet(AllowPUTAsCreateMixin,
                             mixins.UpdateModelMixin,
                             viewsets.GenericViewSet):

    queryset = ModeratorRemark.objects
    serializer_class = ModeratorRemarkSerializer
    permission_classes = (IsModerator, )
    lookup_field = 'idea__slug'

    def get_permission_object(self):
        return self.remark<commit_msg>remark api now returns remark via HTTP GET<commit_after>from rest_framework import mixins
from rest_framework import viewsets

from adhocracy4.api.mixins import AllowPUTAsCreateMixin
from adhocracy4.api.permissions import IsModerator

from .models import ModeratorRemark
from .serializers import ModeratorRemarkSerializer


class ModeratorRemarkViewSet(AllowPUTAsCreateMixin,
                             mixins.UpdateModelMixin,
                             mixins.RetrieveModelMixin,
                             viewsets.GenericViewSet):

    queryset = ModeratorRemark.objects
    serializer_class = ModeratorRemarkSerializer
    permission_classes = (IsModerator, )
    lookup_field = 'idea__slug'

    def get_permission_object(self):
        return self.remark
{'fraction_non_alphanumeric': 0.04278812974465148, 'fraction_numerical': 0.0027605244996549345, 'mean_word_length': 3.380664652567976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '960423', 'n_tokens_mistral': 402, 'n_tokens_neox': 393, 'n_words': 87}