diff options
Diffstat (limited to 'debug_toolbar/management/commands/debugsqlshell.py')
| -rw-r--r-- | debug_toolbar/management/commands/debugsqlshell.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/debug_toolbar/management/commands/debugsqlshell.py b/debug_toolbar/management/commands/debugsqlshell.py index e323401..6bb16de 100644 --- a/debug_toolbar/management/commands/debugsqlshell.py +++ b/debug_toolbar/management/commands/debugsqlshell.py @@ -9,12 +9,12 @@ from debug_toolbar.utils import sqlparse class PrintQueryWrapper(util.CursorDebugWrapper): def execute(self, sql, params=()): - starttime = datetime.today() + starttime = datetime.now() try: return self.cursor.execute(sql, params) finally: raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params) - execution_time = datetime.today() - starttime + execution_time = datetime.now() - starttime print sqlparse.format(raw_sql, reindent=True) print print 'Execution time: %fs' % execution_time.total_seconds() |
