summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSamuel Searles-Bryant <sam@samueljsb.co.uk>2026-04-18 12:59:39 +0300
committerJacob Walls <jacobtylerwalls@gmail.com>2026-05-20 12:16:30 -0400
commit20960df455fffd73d556a5ed92cdf6832c23e65f (patch)
treeb7926cfe2c9fc3e01468d805f89a3013831df1b4 /docs
parent3ca621a38642bfd8fc2bfd308f489cc2d9e76fb0 (diff)
Fixed #37045 -- Renamed savepoint() to savepoint_create().
This makes the name consistent with the `savepoint_commit` and `savepoint_rollback` functions. The previous name is maintained as a deprecated alias. This also frees up the `savepoint` name, which would allow the context manager from `django-subatomic` to be included in Django. Co-authored-by: Lily <code@lilyf.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/releases/6.1.txt3
-rw-r--r--docs/topics/db/transactions.txt15
3 files changed, 19 insertions, 2 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 1e6415e484..2cb6a15f2f 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -126,6 +126,9 @@ details on these changes.
* Support for overriding ``ModelAdmin.get_action_choices()`` without the new
``action_location`` parameter will be removed.
+* The ``django.db.transaction.savepoint()`` alias to
+ ``django.db.transaction.savepoint_create()`` will be removed.
+
.. _deprecation-removed-in-6.1:
6.1
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt
index 12596d4fe6..b041bbdda0 100644
--- a/docs/releases/6.1.txt
+++ b/docs/releases/6.1.txt
@@ -791,6 +791,9 @@ Miscellaneous
* Overriding ``ModelAdmin.get_action_choices()`` without the new
``action_location`` parameter is deprecated.
+* ``django.db.transaction.savepoint()`` is deprecated in favor of
+ ``django.db.transaction.savepoint_create()``.
+
Features removed in 6.1
=======================
diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt
index c44c8c6ee7..4733a95bf8 100644
--- a/docs/topics/db/transactions.txt
+++ b/docs/topics/db/transactions.txt
@@ -547,6 +547,17 @@ Savepoints are controlled by three functions in :mod:`django.db.transaction`:
.. function:: savepoint(using=None)
+ .. deprecated:: 6.1
+
+ ``savepoint`` has been renamed to ``savepoint_create``.
+
+ Creates a new savepoint. This marks a point in the transaction that is
+ known to be in a "good" state. Returns the savepoint ID (``sid``).
+
+.. function:: savepoint_create(using=None)
+
+ .. versionadded:: 6.1
+
Creates a new savepoint. This marks a point in the transaction that is
known to be in a "good" state. Returns the savepoint ID (``sid``).
@@ -579,7 +590,7 @@ The following example demonstrates the use of savepoints::
a.save()
# transaction now contains a.save()
- sid = transaction.savepoint()
+ sid = transaction.savepoint_create()
b.save()
# transaction now contains a.save() and b.save()
@@ -692,7 +703,7 @@ you can roll back the single offending operation, rather than the entire
transaction. For example::
a.save() # Succeeds, and never undone by savepoint rollback
- sid = transaction.savepoint()
+ sid = transaction.savepoint_create()
try:
b.save() # Could throw exception
transaction.savepoint_commit(sid)