Created
June 19, 2014 20:13
-
-
Save jlmitch5/169165946c28a8949edc to your computer and use it in GitHub Desktop.
mixin rest classes workign doc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from schema_kernel.models import KernelVersion | |
from schema_kernel.serializers import KernelVersionSerializer | |
from rest_framework import mixins, generics | |
class KVList(mixins.ListModelMixin, generics.GenericAPIView): | |
queryset = KernelVersion.objects.all() | |
serializer_class = KernelVersionSerializer | |
def get(self, request, *args, **kwargs): | |
return self.list(request, *args, **kwargs) | |
class KVDetail(mixins.RetrieveModelMixin, generics.GenericAPIView): | |
queryset = KernelVersion.objects.all() | |
serializer_class = KernelVersionSerializer | |
def get(self, request, *args, **kwargs): | |
return self.retrieve(request, *args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment