Created
July 18, 2015 14:29
-
-
Save jason-kane/b66982d63ab81c0db6b3 to your computer and use it in GitHub Desktop.
DRS MyCustomView without params
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
class MyCustomView(APIView): | |
""" | |
This is a custom view that can be anything at all. | |
It's not using a serializer class, but I can define my own parameters. | |
Cet exemple démontre l'utilisation de caractères unicode | |
""" | |
def get(self, *args, **kwargs): | |
""" | |
Get the single object. | |
""" | |
return Response({'foo': 'bar'}) | |
def post(self, request, *args, **kwargs): | |
""" | |
Post to see your horse's name. | |
""" | |
return Response({'horse': request.GET.get('horse')}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment