2020-02-23 18:00:42 +00:00
|
|
|
from rest_framework import viewsets, permissions
|
2020-02-21 15:33:37 +00:00
|
|
|
|
2020-09-28 18:59:08 +00:00
|
|
|
#from .models import VM
|
|
|
|
# from .serializers import OpenNebulaVMSerializer
|
2020-02-23 14:33:26 +00:00
|
|
|
|
2020-09-28 18:59:08 +00:00
|
|
|
# class VMViewSet(viewsets.ModelViewSet):
|
|
|
|
# permission_classes = [permissions.IsAuthenticated]
|
|
|
|
# serializer_class = OpenNebulaVMSerializer
|
2020-02-23 15:52:30 +00:00
|
|
|
|
2020-09-28 18:59:08 +00:00
|
|
|
# def get_queryset(self):
|
|
|
|
# if self.request.user.is_superuser:
|
|
|
|
# obj = VM.objects.all()
|
|
|
|
# else:
|
|
|
|
# obj = VM.objects.filter(owner=self.request.user)
|
2020-02-23 15:52:30 +00:00
|
|
|
|
2020-09-28 18:59:08 +00:00
|
|
|
# return obj
|