File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -170,20 +170,18 @@ Update
170
170
171
171
The ``Update `` operation functions similarly to ``Model.update ``.
172
172
173
- * ``model_cls `` (required)
174
- * ``hash_key `` (required)
175
- * ``range_key `` (optional)
173
+ * ``model `` (required)
176
174
* ``actions `` (required) - a list of type :py:class: `Action <pynamodb.expressions.update.Action> ` (see :ref: `updates `)
177
175
* ``condition `` (optional) - of type :py:class: `Condition <pynamodb.expressions.condition.Condition> ` (see :ref: `conditional `)
178
176
* ``return_values `` (optional) - the values that should be returned if the condition fails (:ref: `return_values_on_check_failure_save `)
179
177
180
178
181
179
.. code-block :: python
182
180
181
+ user1_statement = BankStatement(' user1' )
183
182
with TransactWrite(connection = connection) as transaction:
184
183
transaction.update(
185
- BankStatement,
186
- ' user1' ,
184
+ user1_statement,
187
185
actions = [BankStatement.account_balance.set(0 ), BankStatement.is_active.set(False )]
188
186
condition = (BankStatement.user_id.exists())
189
187
)
You can’t perform that action at this time.
0 commit comments