from django.shortcuts import render

# Create your views here.
from rest_framework import viewsets
from stats.models import StatsLog
from stats.serializers import StatsLogSerializer

from back_latienda.permissions import IsStaff


class StatsLogViewSet(viewsets.ModelViewSet):
      queryset = StatsLog.objects.all()
      serializer_class = StatsLogSerializer
      permission_classes = [IsStaff,]

      def perform_create(self, serializer):
            serializer.save(creator=self.request.user)


