Answer the question
In order to leave comments, you need to log in
How to pass a class method as a parameter to a class method decorator?
The layout is like this:
class Foo():
@condition(last_modified_func=get_obj_mtime)
def retrieve(self, request, *args, **kwargs):
блаблабла
def condition(etag_func=None, last_modified_func=None):
def decorator(func):
@wraps(func, assigned=available_attrs(func))
def inner(request, *args, **kwargs):
# Get HTTP request headers
блаблабла
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question