django-fancy-cache
django-fancy-cache copied to clipboard
View keyword arguments not available in prefixer function
User Henri Witteveen reports that his prefixer function isn't being called with the same parameters as the view is.
I had this issue too but got the view kwargs using the request resolver.
def my_prefix_function(request):
# Get the parameters from the URL.
view_kwargs = request.resolver_match.kwargs
# Return a key.
return '-'.join(i[1] for i in sorted(view_kwargs.items())
Hope this helps.
I'm not using this library myself anymore. But if you are and you think that fix is important and easy to add, please create a PR. I think there are some unit tests that you could extend.