This commit is contained in:
parent
dbd622ed9d
commit
444839b8e6
1 changed files with 7 additions and 1 deletions
|
|
@ -6,17 +6,23 @@ import logging
|
||||||
|
|
||||||
from sqlmodel import Session
|
from sqlmodel import Session
|
||||||
from textual.app import App
|
from textual.app import App
|
||||||
|
from textual.logging import TextualHandler
|
||||||
|
|
||||||
from .database import create_db_and_tables, engine
|
from .database import create_db_and_tables, engine
|
||||||
from .models import Teilchen, make_teilchen_input
|
from .models import Teilchen, make_teilchen_input
|
||||||
from .tui import AddInventoryScreen
|
from .tui import AddInventoryScreen
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
level="NOTSET",
|
||||||
|
handlers=[TextualHandler()],
|
||||||
|
)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SammlerApp(App[None]):
|
class SammlerApp(App[None]):
|
||||||
async def on_mount(self) -> None:
|
async def on_mount(self) -> None:
|
||||||
create_db_and_tables()
|
create_db_and_tables()
|
||||||
|
try_this()
|
||||||
_ = self.push_screen(AddInventoryScreen())
|
_ = self.push_screen(AddInventoryScreen())
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,7 +42,7 @@ def try_this():
|
||||||
session.commit()
|
session.commit()
|
||||||
session.refresh(db_teilchen)
|
session.refresh(db_teilchen)
|
||||||
|
|
||||||
print(f"{db_teilchen=}")
|
logger.info(f"{db_teilchen=}")
|
||||||
|
|
||||||
|
|
||||||
app = SammlerApp()
|
app = SammlerApp()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue