mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Demonstration (in code, look at the diff) of attribute validation
This commit is contained in:
parent
c2a17ab6a3
commit
5314927b6b
|
@ -12,6 +12,10 @@ factory = RequestFactory()
|
||||||
|
|
||||||
|
|
||||||
class BasicView(APIView):
|
class BasicView(APIView):
|
||||||
|
## Uncomment this to see how attribute validation works
|
||||||
|
# valid_attributes = ('foo', )
|
||||||
|
# foo = 'foo'
|
||||||
|
# bar = 'bar'
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
return Response({'method': 'GET'})
|
return Response({'method': 'GET'})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user