Coverage for django_query_capture/middleware.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-11-20 10:20 +0000

1""" 

2Middleware using [query_capture][decorators.query_capture] available in django 

3""" 

4from django_query_capture import query_capture 

5 

6 

7class QueryCaptureMiddleware: 

8 """ 

9 Capture all queries that occur when one request occurs and output them to the console. 

10 """ 

11 

12 def __init__(self, get_response): 

13 self.get_response = get_response 

14 

15 @query_capture() 

16 def __call__(self, request): 

17 return self.get_response(request)