mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
add ExampleTagsViewSet view
This commit is contained in:
parent
25f1425708
commit
05d8a7b5c9
|
@ -137,3 +137,14 @@ class ExampleValidatedAPIView(generics.GenericAPIView):
|
|||
url='http://localhost', uuid=uuid.uuid4(), ip4='127.0.0.1', ip6='::1',
|
||||
ip='192.168.1.1')
|
||||
return Response(serializer.data)
|
||||
|
||||
|
||||
class ExampleTagsViewSet(GenericViewSet):
|
||||
serializer_class = ExampleSerializer
|
||||
|
||||
def retrieve(self, request, *args, **kwargs):
|
||||
serializer = self.get_serializer(integer=33, string='hello', regex='foo', decimal1=3.55,
|
||||
decimal2=5.33, email='a@b.co',
|
||||
url='http://localhost', uuid=uuid.uuid4(), ip4='127.0.0.1', ip6='::1',
|
||||
ip='192.168.1.1')
|
||||
return Response(serializer.data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user