Ticket #25955: django_master_v2.patch

File django_master_v2.patch, 3.1 KB (added by Artyem Klimenko, 9 years ago)
  • django/db/backends/oracle/base.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    206206
    207207    def get_connection_params(self):
    208208        conn_params = self.settings_dict['OPTIONS'].copy()
    209         if 'use_returning_into' in conn_params:
    210             del conn_params['use_returning_into']
     209        conn_params.pop('use_returning_into', None)
     210        conn_params.pop('savepoint_check_constraints', None)
    211211        return conn_params
    212212
    213213    def get_new_connection(self, conn_params):
  • django/db/backends/base/base.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    6363        self.savepoint_state = 0
    6464        # List of savepoints created by 'atomic'.
    6565        self.savepoint_ids = []
     66        self._savepoint_check_constraints = False
    6667        # Tracks if the outermost 'atomic' block should commit on exit,
    6768        # ie. if autocommit was active on entry.
    6869        self.commit_on_exit = True
     
    161162        self.in_atomic_block = False
    162163        self.savepoint_ids = []
    163164        self.needs_rollback = False
     165        self._savepoint_check_constraints = self.settings_dict['OPTIONS']\
     166            .get('savepoint_check_constraints', False) and \
     167            self.features.can_defer_constraint_checks
    164168        # Reset parameters defining when to close the connection
    165169        max_age = self.settings_dict['CONN_MAX_AGE']
    166170        self.close_at = None if max_age is None else time.time() + max_age
     
    340344            return
    341345
    342346        self.validate_thread_sharing()
     347        self.savepoint_check_constraints()
    343348        self._savepoint_commit(sid)
    344349
    345350    def clean_savepoints(self):
     
    465470        IntegrityError if any invalid foreign key references are encountered.
    466471        """
    467472        pass
     473
     474    def savepoint_check_constraints(self):
     475        if self._savepoint_check_constraints:
     476            self.check_constraints()
     477
    468478
    469479    # ##### Connection termination handling #####
    470480
  • django/db/backends/postgresql/base.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    161161        }
    162162        conn_params.update(settings_dict['OPTIONS'])
    163163        conn_params.pop('isolation_level', None)
     164        conn_params.pop('savepoint_check_constraints', None)
    164165        if settings_dict['USER']:
    165166            conn_params['user'] = settings_dict['USER']
    166167        if settings_dict['PASSWORD']:
Back to Top