Ticket #22873: trinary.patch

File trinary.patch, 892 bytes (added by john@…, 13 months ago)

Proposed patch for django/db/backends/init.py

  • django/db/backends/__init__.py

    diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
    index 8acfde0..3ff43bc 100644
    a b class BaseDatabaseWrapper(object): 
    4545        self.alias = alias
    4646        # Query logging in debug mode or when explicitly enabled.
    4747        self.queries_log = deque(maxlen=self.queries_limit)
    48         self.use_debug_cursor = False
     48        self.use_debug_cursor = None
    4949
    5050        # Transaction related attributes.
    5151        # Tracks if the connection is in autocommit mode. Per PEP 249, by
    class BaseDatabaseWrapper(object): 
    7575
    7676    @property
    7777    def queries_logged(self):
    78         return self.use_debug_cursor or settings.DEBUG
     78        return (self.use_debug_cursor or
     79            (self.use_debug_cursor is None and settings.DEBUG))
    7980
    8081    @property
    8182    def queries(self):
Back to Top