Skip to content

Commit 30b38de

Browse files
hallieikonst
authored andcommitted
Fix incorrect documentation for Transaction.update (#717)
1 parent 9ff14d4 commit 30b38de

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/transaction.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,18 @@ Update
170170

171171
The ``Update`` operation functions similarly to ``Model.update``.
172172

173-
* ``model_cls`` (required)
174-
* ``hash_key`` (required)
175-
* ``range_key`` (optional)
173+
* ``model`` (required)
176174
* ``actions`` (required) - a list of type :py:class:`Action <pynamodb.expressions.update.Action>` (see :ref:`updates`)
177175
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
178176
* ``return_values`` (optional) - the values that should be returned if the condition fails (:ref:`return_values_on_check_failure_save`)
179177

180178

181179
.. code-block:: python
182180
181+
user1_statement = BankStatement('user1')
183182
with TransactWrite(connection=connection) as transaction:
184183
transaction.update(
185-
BankStatement,
186-
'user1',
184+
user1_statement,
187185
actions=[BankStatement.account_balance.set(0), BankStatement.is_active.set(False)]
188186
condition=(BankStatement.user_id.exists())
189187
)

0 commit comments

Comments
 (0)