mirror of
https://github.com/Rushilwiz/house-party.git
synced 2025-04-19 02:50:18 -04:00
16 lines
498 B
Python
16 lines
498 B
Python
from django.shortcuts import render
|
|
from rest_framework.generics import CreateAPIView
|
|
from rest_framework.response import Response
|
|
from .serializers import RoomSerializer
|
|
from .models import Room
|
|
|
|
# Create your views here.
|
|
|
|
class RoomView(CreateAPIView):
|
|
queryset = Room.objects.all()
|
|
serializer_class = RoomSerializer
|
|
|
|
def get(self, request, format=None):
|
|
rooms = Room.objects.all()
|
|
serializer = RoomSerializer(rooms, many=True)
|
|
return Response(serializer.data) |