mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
No need to use setattr
This commit is contained in:
parent
c13c8fe5bc
commit
686a034817
|
@ -50,34 +50,34 @@ def api_view(http_method_names):
|
||||||
|
|
||||||
def renderer_classes(renderer_classes):
|
def renderer_classes(renderer_classes):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
setattr(func, 'renderer_classes', renderer_classes)
|
func.renderer_classes = renderer_classes
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def parser_classes(parser_classes):
|
def parser_classes(parser_classes):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
setattr(func, 'parser_classes', parser_classes)
|
func.parser_classes = parser_classes
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def authentication_classes(authentication_classes):
|
def authentication_classes(authentication_classes):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
setattr(func, 'authentication_classes', authentication_classes)
|
func.authentication_classes = authentication_classes
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def throttle_classes(throttle_classes):
|
def throttle_classes(throttle_classes):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
setattr(func, 'throttle_classes', throttle_classes)
|
func.throttle_classes = throttle_classes
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def permission_classes(permission_classes):
|
def permission_classes(permission_classes):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
setattr(func, 'permission_classes', permission_classes)
|
func.permission_classes = permission_classes
|
||||||
return func
|
return func
|
||||||
return decorator
|
return decorator
|
||||||
|
|
Loading…
Reference in New Issue
Block a user