<commit_before>from django.db.models import Q
from django.http import Http404

from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import mixins
from rest_framework import generics

from .models import Event
from .serializers import EventSerializer


class EventList(generics.ListAPIView):
    serializer_class = EventSerializer
    model = Event

    def get_queryset(self):
        qs = Event.objects.all()

        if self.request.GET.get('location'):
            qs = qs.filter(location=int(self.request.GET.get('location')))

        print str(qs)

        #if self.request.GET.get('visiblity'):
        #    qs = qs | Event.objects.filter(visibility=self.request.GET.get('visibility'))

        return qs<commit_msg>allow handling of multiple location filters for CalendarEvent<commit_after>from django.db.models import Q
from django.http import Http404

from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import mixins
from rest_framework import generics

from .models import Event
from .serializers import EventSerializer


class EventList(generics.ListAPIView):
    serializer_class = EventSerializer
    model = Event

    def get_queryset(self):
        qs = Event.objects.all()

        if self.request.GET.get('location'):
            locations = [int(val) for val in self.request.GET.get('location').split(',')]
            qs = qs.filter(location__in=locations)

        print str(qs)

        #if self.request.GET.get('visiblity'):
        #    qs = qs | Event.objects.filter(visibility=self.request.GET.get('visibility'))

        return qs
{'fraction_non_alphanumeric': 0.08823529411764706, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 3.6143617021276597, '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': '3362600', 'n_tokens_mistral': 499, 'n_tokens_neox': 470, 'n_words': 130}