mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +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 decorator(func):
|
||||
setattr(func, 'renderer_classes', renderer_classes)
|
||||
func.renderer_classes = renderer_classes
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def parser_classes(parser_classes):
|
||||
def decorator(func):
|
||||
setattr(func, 'parser_classes', parser_classes)
|
||||
func.parser_classes = parser_classes
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def authentication_classes(authentication_classes):
|
||||
def decorator(func):
|
||||
setattr(func, 'authentication_classes', authentication_classes)
|
||||
func.authentication_classes = authentication_classes
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def throttle_classes(throttle_classes):
|
||||
def decorator(func):
|
||||
setattr(func, 'throttle_classes', throttle_classes)
|
||||
func.throttle_classes = throttle_classes
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def permission_classes(permission_classes):
|
||||
def decorator(func):
|
||||
setattr(func, 'permission_classes', permission_classes)
|
||||
func.permission_classes = permission_classes
|
||||
return func
|
||||
return decorator
|
||||
|
|
Loading…
Reference in New Issue
Block a user