-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when retrieving cache #119
Comments
Someone here seems to have the same issue but that's all I could find: http://stackoverflow.com/questions/33356687/typeerror-from-django-cache |
Exception Value: new() takes exactly 3 arguments (2 given) |
dj 1.9 support would be added soon. but PR's are well come if you are proactive. |
would u plz share the code? |
I'd be happy to send a PR once I figure out what's going on! This is my code, nothing fancy: class MarkerCacheKey(DefaultKeyConstructor):
query_params = bits.QueryParamsKeyBit('*')
pagination = bits.PaginationKeyBit('*')
class MarkerFullViewSet(viewsets.ModelViewSet):
"""
API endpoint that lists all markers in the db, without comments.
"""
queryset = Marker.objects.all()
serializer_class = MarkerFullSerializer
pagination_class = LargeResultsSetPagination
@cache_response(24 * 60 * 60, key_func=MarkerCacheKey()) # cache for one day
def list(self, *args, **kwargs):
return super(MarkerFullViewSet, self).list(*args, **kwargs) |
I have the same issue with a simple UserViewSet (with the default Django User model) and no custom key function, so it doesn't seem to come from my code. |
Some news of Django 1.9 support ? |
I upgraded to 3.3.1 and everything seems to be working fine so I'll close this. It was related to this bug encode/django-rest-framework#3628 in DRF. |
haha |
Hi, I upgraded to Django 1.9 and the caching seems to be broken. I don't think you support 1.9 yet, but maybe someone here has an idea of where I can look? Thanks!
The text was updated successfully, but these errors were encountered: