MCPcopy
hub / github.com/ormar-orm/ormar / run_query

Function run_query

docs_src/signals/docs002.py:38–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36
37@create_drop_database(base_config=ormar_base_config)
38async def run_query():
39 # here album.play_count and is_best_seller get default values
40 album = await Album.objects.create(name="Venice")
41 assert not album.is_best_seller
42 assert album.play_count == 0
43
44 album.play_count = 30
45 # here a trigger is called but play_count is too low
46 await album.update()
47 assert not album.is_best_seller
48
49 album.play_count = 60
50 await album.update()
51 assert album.is_best_seller
52
53
54asyncio.run(run_query())

Callers 1

docs002.pyFile · 0.70

Calls 2

createMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected