Skip to content

Commit 16535e9

Browse files
committed
adding uncommitted changes
1 parent f900e3a commit 16535e9

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

piccolo/table.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,30 @@ def update(
632632
"""
633633
Update rows.
634634
635-
await Band.update().values(
636-
{Band.name: "Spamalot"}
637-
).where(
638-
Band.name=="Pythonistas"
639-
).run()
635+
All of the following work, though the first is preferable:
636+
637+
.. code-block:: python
638+
639+
await Band.update(
640+
{Band.name: "Spamalot"}
641+
).where(
642+
Band.name=="Pythonistas"
643+
).run()
644+
645+
await Band.update(
646+
{"name": "Spamalot"}
647+
).where(
648+
Band.name=="Pythonistas"
649+
).run()
650+
651+
await Band.update(
652+
name="Spamalot"
653+
).where(
654+
Band.name=="Pythonistas"
655+
).run()
656+
640657
"""
658+
values = dict(values, **kwargs)
641659
return Update(table=cls).values(values)
642660

643661
@classmethod

0 commit comments

Comments
 (0)