Closed cosmith closed 8 years ago
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 https://github.com/tomchristie/django-rest-framework/issues/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!