def get_conditional_response(self, *args, **kwargs):
return condition(
self.etag_func,
self.last_modified_func
)(super(self.__class__, self).dispatch)(
*args, **kwargs
)
python类condition()的实例源码
def get_handler(self, request):
handler = super().get_handler(request)
if handler and self.method in ('get', 'head'):
return condition(
last_modified_func=self._last_modified,
etag_func=self.etag,
)(handler)
else:
return handler