mirror of
https://github.com/nprasad2077/nbaStats.git
synced 2026-11-05 17:45:48 +00:00
18 lines
484 B
Python
18 lines
484 B
Python
from django.shortcuts import render
|
|
from django.http import JsonResponse
|
|
from django.core import serializers
|
|
from .models import PlayerData
|
|
from rest_framework import generics
|
|
from .serializers import PlayerDataSerializer
|
|
|
|
|
|
# Create your views here.
|
|
|
|
# API view to list all PlayerData instances
|
|
class PlayerDataList(generics.ListCreateAPIView):
|
|
queryset = PlayerData.objects.all().order_by('id')
|
|
serializer_class = PlayerDataSerializer
|
|
# pagination_class = None
|
|
|
|
|