first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:22:29 +03:00
commit ec28a2024d
208 changed files with 23836 additions and 0 deletions

18
utils/views.py Normal file
View File

@@ -0,0 +1,18 @@
from django.shortcuts import render
from rest_framework.generics import ListCreateAPIView
from rest_framework.permissions import IsAuthenticated
from utils.models import JsonToType
from utils.serializers import JsonToTypeSerializer
# Create your views here.
class JsonToTypeListCreate(ListCreateAPIView):
permission_classes = [IsAuthenticated]
serializer_class = JsonToTypeSerializer
def get_queryset(self):
return JsonToType.objects.filter(user=self.request.user, is_active=True).order_by('-updated_at')
def perform_create(self, serializer):
serializer.save(user=self.request.user)