39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
from django.http import HttpResponse
|
|
from rest_framework import viewsets
|
|
from .models import Game, Guild, Player, PlayerGameProfile, WowProfile, ValorantProfile
|
|
from .serializers import GameSerializer, GuildSerializer, PlayerSerializer, PlayerGameProfileSerializer, WowProfileSerializer, ValorantProfileSerializer
|
|
|
|
|
|
def hello_world(request):
|
|
return HttpResponse("Hello, World!")
|
|
|
|
|
|
class GameViewSet(viewsets.ModelViewSet):
|
|
queryset = Game.objects.all()
|
|
serializer_class = GameSerializer
|
|
|
|
|
|
class GuildViewSet(viewsets.ModelViewSet):
|
|
queryset = Guild.objects.all()
|
|
serializer_class = GuildSerializer
|
|
|
|
|
|
class PlayerViewSet(viewsets.ModelViewSet):
|
|
queryset = Player.objects.all()
|
|
serializer_class = PlayerSerializer
|
|
|
|
|
|
class PlayerGameProfileViewSet(viewsets.ModelViewSet):
|
|
queryset = PlayerGameProfile.objects.all()
|
|
serializer_class = PlayerGameProfileSerializer
|
|
|
|
|
|
class WowProfileViewSet(viewsets.ModelViewSet):
|
|
queryset = WowProfile.objects.all()
|
|
serializer_class = WowProfileSerializer
|
|
|
|
|
|
class ValorantProfileViewSet(viewsets.ModelViewSet):
|
|
queryset = ValorantProfile.objects.all()
|
|
serializer_class = ValorantProfileSerializer
|