[deps] drop tortoise in favour of sqlmodel
This commit is contained in:
parent
5a190fe590
commit
de9a8497d8
5 changed files with 209 additions and 213 deletions
|
|
@ -16,9 +16,6 @@ from textual.widgets import (
|
|||
Input,
|
||||
Static,
|
||||
)
|
||||
from tortoise import Tortoise
|
||||
|
||||
from teilchensammler_cli import settings
|
||||
|
||||
|
||||
@final
|
||||
|
|
@ -99,14 +96,8 @@ class AddInventoryScreen(Screen[None]):
|
|||
@final
|
||||
class SammlerApp(App[None]):
|
||||
async def on_mount(self) -> None:
|
||||
await Tortoise.init(config=settings.TORTOISE_ORM_CONFIG)
|
||||
await Tortoise.generate_schemas(safe=True)
|
||||
_ = self.push_screen(AddInventoryScreen())
|
||||
|
||||
async def on_unmount(self) -> None:
|
||||
# https://tortoise.github.io/setup.html#the-importance-of-cleaning-up
|
||||
await Tortoise.close_connections()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
app = SammlerApp()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue