Created
November 15, 2021 11:58
-
-
Save codemation/69511c981f9ff75fd96eb1c3e8d62f13 to your computer and use it in GitHub Desktop.
pydbantic_app_8.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app.py | |
import asyncio | |
from db import setup_database | |
from models import Employee, Positions, Department | |
async def main(): | |
# setup db | |
await setup_database() | |
all_positions = await Positions.all() | |
print(all_positions) | |
for position in all_positions: | |
await position.delete() | |
all_employees = await Employee.all() | |
print(all_employees) | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment