@@ -16,7 +16,7 @@ and is committed with `COMMIT`.
1616A transaction can be ended without committing using ` ROLLBACK ` .
1717
1818When using Django Subatomic,
19- transactions are created with ` django_subatomic.db.transaction ` ,
19+ transactions are created with [ ` transaction ` ] [ django_subatomic.db.transaction ] ,
2020which can be used as both a decorator and a context manager.
2121
2222!!! Note
@@ -51,7 +51,7 @@ In SQL terms, a savepoint is created with `SAVEPOINT <name>`.
5151It is rolled back with ` ROLLBACK TO <name> `
5252and discarded with ` RELEASE SAVEPOINT <name> ` .
5353
54- Subatomic creates savepoints using ` django_subatomic.db.savepoint ` .
54+ Subatomic creates savepoints using [ ` savepoint ` ] [ django_subatomic.db.savepoint ] .
5555This is a context manager,
5656and cannot be used as a decorator.
5757
@@ -65,23 +65,23 @@ and cannot be used as a decorator.
6565Sometimes code needs to make multiple database changes atomically
6666in a place that should not be responsible for managing a transactions.
6767
68- Decorate this code with ` @ django_subatomic.db.transaction_required`
68+ Decorate this code with [ ` @transaction_required ` ] [ django_subatomic.db.transaction_required ]
6969to make it raise an exception when someone tries to run it without first opening a transaction.
7070
7171!!! Tip
7272
73- Where possible, use `transaction_required` as a decorator.
73+ Where possible, use [ `transaction_required`][django_subatomic.db.transaction_required] as a decorator.
7474
7575 This form is preferred because it fails earlier,
7676 and presents a clearer requirement to programmers.
7777
78- You can still use `transaction_required` as a context manager though.
78+ You can still use [ `transaction_required`][django_subatomic.db.transaction_required] as a context manager though.
7979 This might be useful in code where you cannot know the required database
8080 (such as when the database name is passed in as a function parameter).
8181
8282!!! Warning
8383
84- When testing code which uses `transaction_required`
84+ When testing code which uses [ `transaction_required`][django_subatomic.db.transaction_required],
8585 you might see `_MissingRequiredTransaction`
8686 even though tests are run in a transaction by default.
8787
@@ -93,15 +93,15 @@ to make it raise an exception when someone tries to run it without first opening
9393 then you have probably forgotten to open a transaction.
9494
9595 The trade-off is that lower-level tests will see this error too.
96- If you're testing `transaction_required` code directly,
96+ If you're testing [ `transaction_required`][django_subatomic.db.transaction_required] code directly,
9797 and you're _sure_ that the code shouldn't be responsible for opening a transaction,
98- use the ` django_subatomic.test.part_of_a_transaction()` decorator/context-manager
98+ use the [`part_of_a_transaction`][ django_subatomic.test.part_of_a_transaction] decorator/context-manager
9999 to get things working.
100100 This will not run after-commit hooks.
101101 If you'd like those to run, create a [transaction](#transactions) instead.
102102
103103When "create-a-transaction-if-one-doesn't-already-exist" behaviour is required,
104- the ` transaction_if_not_already ` function will provide it.
104+ the [ ` transaction_if_not_already ` ] [ django_subatomic.db.transaction_if_not_already ] function will provide it.
105105This approach hints that transactional behaviour is not well-defined:
106106the code will do different things in different contexts,
107107which makes it hard to know what to expect from it.
0 commit comments