I am using the django http condition to set the last_modified and e_tag headers. Here is my set up:
def my_last_modified(request, *args, **kwargs):
return None
def get_etag_key(request, *args, **kwargs):
return None
class ProductsListAPIView(ListAPIView):
queryset = Product.objects.active() # I want to get this value in the functions
serializer_class = ProductSerializer
@condition(etag_func=get_etag_key, last_modified_func=my_last_modified)
def get(self, *args, **kwargs):
return super(ProductsListAPIView, self).get(*args, **kwargs)
What I want to do is get this variable queryset
from the main class in the get_etag_key
and my_last_modified
functions.
Is there any way to go about this?