Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
cd364efa
Kaydet (Commit)
cd364efa
authored
Mar 03, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Stopped flipping the uses_savepoints feature at runtime.
üst
af9e9386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
__init__.py
django/db/backends/__init__.py
+3
-3
base.py
django/db/backends/postgresql_psycopg2/base.py
+1
-4
No files found.
django/db/backends/__init__.py
Dosyayı görüntüle @
cd364efa
...
@@ -161,17 +161,17 @@ class BaseDatabaseWrapper(object):
...
@@ -161,17 +161,17 @@ class BaseDatabaseWrapper(object):
##### Backend-specific savepoint management methods #####
##### Backend-specific savepoint management methods #####
def
_savepoint
(
self
,
sid
):
def
_savepoint
(
self
,
sid
):
if
not
self
.
features
.
uses_savepoints
:
if
not
self
.
features
.
uses_savepoints
or
self
.
autocommit
:
return
return
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_create_sql
(
sid
))
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_create_sql
(
sid
))
def
_savepoint_rollback
(
self
,
sid
):
def
_savepoint_rollback
(
self
,
sid
):
if
not
self
.
features
.
uses_savepoints
:
if
not
self
.
features
.
uses_savepoints
or
self
.
autocommit
:
return
return
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_rollback_sql
(
sid
))
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_rollback_sql
(
sid
))
def
_savepoint_commit
(
self
,
sid
):
def
_savepoint_commit
(
self
,
sid
):
if
not
self
.
features
.
uses_savepoints
:
if
not
self
.
features
.
uses_savepoints
or
self
.
autocommit
:
return
return
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_commit_sql
(
sid
))
self
.
cursor
()
.
execute
(
self
.
ops
.
savepoint_commit_sql
(
sid
))
...
...
django/db/backends/postgresql_psycopg2/base.py
Dosyayı görüntüle @
cd364efa
...
@@ -49,6 +49,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
...
@@ -49,6 +49,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_select_for_update
=
True
has_select_for_update
=
True
has_select_for_update_nowait
=
True
has_select_for_update_nowait
=
True
has_bulk_insert
=
True
has_bulk_insert
=
True
uses_savepoints
=
True
supports_tablespaces
=
True
supports_tablespaces
=
True
supports_transactions
=
True
supports_transactions
=
True
can_distinct_on_fields
=
True
can_distinct_on_fields
=
True
...
@@ -88,8 +89,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
...
@@ -88,8 +89,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self
.
introspection
=
DatabaseIntrospection
(
self
)
self
.
introspection
=
DatabaseIntrospection
(
self
)
self
.
validation
=
BaseDatabaseValidation
(
self
)
self
.
validation
=
BaseDatabaseValidation
(
self
)
self
.
features
.
uses_savepoints
=
False
def
get_connection_params
(
self
):
def
get_connection_params
(
self
):
settings_dict
=
self
.
settings_dict
settings_dict
=
self
.
settings_dict
if
not
settings_dict
[
'NAME'
]:
if
not
settings_dict
[
'NAME'
]:
...
@@ -174,7 +173,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
...
@@ -174,7 +173,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self
.
cursor
()
.
close
()
self
.
cursor
()
.
close
()
if
managed
and
self
.
autocommit
:
if
managed
and
self
.
autocommit
:
self
.
set_autocommit
(
False
)
self
.
set_autocommit
(
False
)
self
.
features
.
uses_savepoints
=
True
def
_leave_transaction_management
(
self
,
managed
):
def
_leave_transaction_management
(
self
,
managed
):
"""
"""
...
@@ -186,7 +184,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
...
@@ -186,7 +184,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
if
not
managed
and
not
self
.
autocommit
:
if
not
managed
and
not
self
.
autocommit
:
self
.
rollback
()
# Must terminate transaction first.
self
.
rollback
()
# Must terminate transaction first.
self
.
set_autocommit
(
True
)
self
.
set_autocommit
(
True
)
self
.
features
.
uses_savepoints
=
False
def
_set_isolation_level
(
self
,
isolation_level
):
def
_set_isolation_level
(
self
,
isolation_level
):
assert
isolation_level
in
range
(
1
,
5
)
# Use set_autocommit for level = 0
assert
isolation_level
in
range
(
1
,
5
)
# Use set_autocommit for level = 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment