Changes between Initial Version and Version 2 of Ticket #28035
- Timestamp:
- Apr 6, 2017, 1:03:53 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28035
- Property Summary Help Django Programmer to link a Query in their database logs with the Python line of codes that generated the request. → Help Django Programmer to link a Query in their database logs with the Python lines of code that generated the request.
- Property Component Uncategorized → Database layer (models, ORM)
- Property Type Uncategorized → New feature
-
Ticket #28035 – Description
initial v2 8 8 9 9 Then you would be able to link easily where your request have been generated from in your python code. 10 11 12 10 {{{ 11 SELECT * FROM users WHERE id = 1; -- users/views.py L.21 `user = Users.objects.get(pk=request.user.id)` 12 }}} 13 13 It is especially useful when you create conditionals QuerySet: 14 15 16 14 {{{ 15 SELECT * FROM users WHERE name LIKE 'enac%' ORDER BY username; -- users/views.py L.18 `qs = Users.objects.all() \n users/views.py L.25 `qs = qs.filter(name__startswith="enac")` \n users/views.py L.30 `qs = qs.order_by('username')` \n templates/user_search.html L.55 `{% for user in users %}` 16 }}} 17 17 If we want to do that as a library outside of Django, it means we would have to monkey patch the QuerySet object. 18 18 Do we want to make it a Django Feature?