Skip to content

Commit 0558bc9

Browse files
authored
Add compat for latest DDT and convenience imports (#12)
* DDT falls down if these kwargs aren't in the logged query: - "djdt_query_id": uuid.uuid4().hex, - "stacktrace": get_stack_trace(), * Add convenience import
1 parent f83fc93 commit 0558bc9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .mql import MQLPanel
2+
3+
__all__ = ["MQLPanel"]

django_mongodb_extensions/debug_toolbar/panels/mql/tracking.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import types
2+
import uuid
23

4+
from debug_toolbar.utils import get_stack_trace
35
from django_mongodb_backend.utils import OperationDebugWrapper
46
from pymongo.collection import Collection
57

@@ -38,6 +40,8 @@ def log(self, op, duration, args, kwargs=None):
3840
"alias": self.db.alias,
3941
"sql": operation,
4042
"duration": "%.3f" % duration,
43+
"djdt_query_id": uuid.uuid4().hex,
44+
"stacktrace": get_stack_trace(),
4145
}
4246
)
4347
self.logger._databases[self.db.alias] = {

0 commit comments

Comments
 (0)