<commit_before># -*- coding: utf-8 -*-

# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.


from akvo.rsr.models import ProjectUpdate

from ..serializers import ProjectUpdateSerializer, ProjectUpdateExtraSerializer
from ..viewsets import BaseRSRViewSet


class ProjectUpdateViewSet(BaseRSRViewSet):
    """
    """
    queryset = ProjectUpdate.objects.all()
    serializer_class = ProjectUpdateSerializer

def get_queryset(self):
    """ Allow simple filtering on selected fields
    """
    queryset = self.queryset
    uuid = self.request.QUERY_PARAMS.get('uuid', None)
    if uuid is not None:
        queryset = self.queryset.filter(uuid=uuid)
    return queryset


class ProjectUpdateExtraViewSet(BaseRSRViewSet):
    """
    """
    queryset = ProjectUpdate.objects.all()
    serializer_class = ProjectUpdateExtraSerializer

    def get_queryset(self):
        """ Allow simple filtering on selected fields
        """
        queryset = self.queryset
        project = self.request.QUERY_PARAMS.get('project', None)
        if project is not None:
            queryset = self.queryset.filter(project=project)
        uuid = self.request.QUERY_PARAMS.get('uuid', None)
        if uuid is not None:
            queryset = self.queryset.filter(uuid=uuid)
        return queryset<commit_msg>[#632] Fix indentation error<commit_after># -*- coding: utf-8 -*-

# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.


from akvo.rsr.models import ProjectUpdate

from ..serializers import ProjectUpdateSerializer, ProjectUpdateExtraSerializer
from ..viewsets import BaseRSRViewSet


class ProjectUpdateViewSet(BaseRSRViewSet):
    """
    """
    queryset = ProjectUpdate.objects.all()
    serializer_class = ProjectUpdateSerializer

    def get_queryset(self):
        """ Allow simple filtering on selected fields
        """
        queryset = self.queryset
        uuid = self.request.QUERY_PARAMS.get('uuid', None)
        if uuid is not None:
            queryset = self.queryset.filter(uuid=uuid)
        return queryset


class ProjectUpdateExtraViewSet(BaseRSRViewSet):
    """
    """
    queryset = ProjectUpdate.objects.all()
    serializer_class = ProjectUpdateExtraSerializer

    def get_queryset(self):
        """ Allow simple filtering on selected fields
        """
        queryset = self.queryset
        project = self.request.QUERY_PARAMS.get('project', None)
        if project is not None:
            queryset = self.queryset.filter(project=project)
        uuid = self.request.QUERY_PARAMS.get('uuid', None)
        if uuid is not None:
            queryset = self.queryset.filter(uuid=uuid)
        return queryset
{'fraction_non_alphanumeric': 0.09025270758122744, 'fraction_numerical': 0.0016409583196586807, 'mean_word_length': 3.0857908847184987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '105696', 'n_tokens_mistral': 853, 'n_tokens_neox': 840, 'n_words': 242}