At present using this inside a class based view:
@method_decorator(cacheback(lifetime=60))
def get_context_data(...):
...
Causes an error: AttributeError: 'functools.partial' object has no attribute '__module__'
The error arises in jobs.prepare_args which uses ("%s:%s" % (fn.__module__, fn.__name__),) + args to serialise the function for the queue. The suggestion here: https://stackoverflow.com/questions/20594193/dynamically-created-method-and-decorator-got-error-functools-partial-object-h
Is that in python 3.5 and later a reference to the original function is maintained in the partial. You can access it as .func.
At present using this inside a class based view:
Causes an error:
AttributeError: 'functools.partial' object has no attribute '__module__'The error arises in
jobs.prepare_argswhich uses("%s:%s" % (fn.__module__, fn.__name__),) + argsto serialise the function for the queue. The suggestion here: https://stackoverflow.com/questions/20594193/dynamically-created-method-and-decorator-got-error-functools-partial-object-hIs that in python 3.5 and later a reference to the original function is maintained in the partial. You can access it as
.func.