INTPYTHON-423 MQL panel for Django Debug Toolbar#29
INTPYTHON-423 MQL panel for Django Debug Toolbar#29aclark4life merged 36 commits intomongodb-labs:mainfrom
Conversation
c4d8429 to
7a10616
Compare
| {% if result %} | ||
| <h4>{% translate "Query Results" %}</h4> |
There was a problem hiding this comment.
Remove {% if %}, otherwise, we have a "Empty set" displayed without a header.
There was a problem hiding this comment.
I think since we have {% if result %} then the result will never be empty.
There was a problem hiding this comment.
I tested this and found a query with "Empty set" so maybe there is some unexpected truthiness behavior somewhere in Django templates.
There was a problem hiding this comment.
The debug toolbar template looks like:
{% if result %}
<table>
<thead>
<tr>
{% for h in headers %}
<th>{{ h|upper }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in result %}
<tr>
{% for column in row %}
<td>{{ column|escape }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% translate "Empty set" %}</p>
{% endif %}
I think what happened is that in a past review, I suggested adding {% empty %}, not seeing {% if result %}.
| def test_title(self): | ||
| mql_call() | ||
| response = self.panel.process_request(self.request) | ||
| self.panel.generate_stats(self.request, response) | ||
| self.assertEqual(self.panel.title, "MQL queries from 1 connection") |
There was a problem hiding this comment.
Did you inadvertently delete the test_title (or at least the assertion for it)?
There was a problem hiding this comment.
I'll put it back and account for multiple connections.
There was a problem hiding this comment.
Or maybe we don't need to test multiple connections?
There was a problem hiding this comment.
Well sure, tests for multiple connections would be nice but I'd prioritize tests for views and templates as that accounts for many more untested lines.
| <tr> | ||
| <th>{{ sub.key }}</th> | ||
| <td> | ||
| {% if sub.type == "dict" %} |
There was a problem hiding this comment.
I think the same code is repeated below, so it could be an {% include %}.
Does it support arbitrary layers of nested documents? It doesn't look like but maybe there is some flattening happening in the form (didn't take time to understand large blocks of uncommented code).
I'm getting uncomfortable with the large amount of logic in this template, but I won't insist on another approach.
There was a problem hiding this comment.
Does it support arbitrary layers of nested documents? It doesn't look like but maybe there is some flattening happening in the form (didn't take time to understand large blocks of uncommented code).
Fixed in 924a954
mongodb-labs#33) Bumps the actions group with 1 update: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action). Updates `zizmorcore/zizmor-action` from 0.5.0 to 0.5.2 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](zizmorcore/zizmor-action@0dce257...71321a2) --- updated-dependencies: - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary of Changes
MQL Panel Enhancements
mql_explain.htmltemplate)mql_select.htmltemplate)forms.py)views.py)tracking.py->utils.pyutils.py)Testing
Project Configuration
.gitignoreDocumentation
Screenshots