Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Re-ordered functions by deprecation status.

  • Loading branch information...
commit 557e40412729c06a2daff34a4cabcb6efb719b32 1 parent ac37ed2
@aaugustin aaugustin authored
Showing with 20 additions and 17 deletions.
  1. +20 −17 django/db/transaction.py
View
37 django/db/transaction.py
@@ -39,17 +39,9 @@ def get_connection(using=None):
using = DEFAULT_DB_ALIAS
return connections[using]
-def get_autocommit(using=None):
- """
- Get the autocommit status of the connection.
- """
- return get_connection(using).autocommit
-
-def set_autocommit(using=None, autocommit=True):
- """
- Set the autocommit status of the connection.
- """
- return get_connection(using).set_autocommit(autocommit)
+###########################
+# Deprecated private APIs #
+###########################
def abort(using=None):
"""
@@ -106,12 +98,6 @@ def set_clean(using=None):
"""
get_connection(using).set_clean()
-def clean_savepoints(using=None):
- """
- Resets the counter used to generate unique savepoint ids in this thread.
- """
- get_connection(using).clean_savepoints()
-
def is_managed(using=None):
warnings.warn("'is_managed' is deprecated.",
PendingDeprecationWarning, stacklevel=2)
@@ -132,6 +118,18 @@ def rollback_unless_managed(using=None):
# Public APIs #
###############
+def get_autocommit(using=None):
+ """
+ Get the autocommit status of the connection.
+ """
+ return get_connection(using).autocommit
+
+def set_autocommit(using=None, autocommit=True):
+ """
+ Set the autocommit status of the connection.
+ """
+ return get_connection(using).set_autocommit(autocommit)
+
def commit(using=None):
"""
Commits a transaction and resets the dirty flag.
@@ -166,6 +164,11 @@ def savepoint_commit(sid, using=None):
"""
get_connection(using).savepoint_commit(sid)
+def clean_savepoints(using=None):
+ """
+ Resets the counter used to generate unique savepoint ids in this thread.
+ """
+ get_connection(using).clean_savepoints()
#################################
# Decorators / context managers #

0 comments on commit 557e404

Please sign in to comment.
Something went wrong with that request. Please try again.