rename project to fhdhview
This commit is contained in:
1 parent
c4d3b6b292
commit
6755875938
51 files changed
+39
-39
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,32 @@
|
||||
# SPDX-FileCopyrightText: 2026 Filmhuis Den Haag
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
||||
debug: bool = False
|
||||
api_password: str = "testertje"
|
||||
sql_file_name: str = "database.db"
|
||||
timezone: str = "Europe/Amsterdam"
|
||||
prices: dict = {
|
||||
"prijzen": [
|
||||
{"label": "Standaard", "price": "€ 12,50"},
|
||||
{"label": "Dagtarief (ma–vr tot 16u)", "price": "€ 11,00"},
|
||||
{"label": "Cineville", "price": "Gratis"},
|
||||
{"label": "Lange film (>180 min)", "price": "€ 15,00"},
|
||||
{"label": "70MM film", "price": "€ 15,00"},
|
||||
],
|
||||
"kortingsprijzen": [
|
||||
{"label": "Jongeren (t/m 26 jaar)", "price": "€ 10,00"},
|
||||
{"label": "Student Nights", "price": "€ 5,00"},
|
||||
{"label": "CJP", "price": "€ 10,00"},
|
||||
{"label": "Vrienden", "price": "€ 9,50"},
|
||||
{"label": "Kinderfilm (t/m 11 jaar)", "price": "€ 8,00"},
|
||||
{"label": "Ooievaarspas", "price": "€ 6,25"},
|
||||
{"label": "De Volharding", "price": "€ 9,00"},
|
||||
],
|
||||
}
|
||||
|
||||
settings = Settings()
|
||||
@@ -0,0 +1,17 @@
|
||||
# SPDX-FileCopyrightText: 2026 Filmhuis Den Haag
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
|
||||
from sqlmodel import SQLModel
|
||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||
|
||||
from fhdhview.core.config import settings
|
||||
|
||||
sqlite_url = f"sqlite+aiosqlite:///{settings.sql_file_name}"
|
||||
|
||||
engine = create_async_engine(sqlite_url, echo=settings.debug)
|
||||
async_session = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
|
||||
|
||||
async def init_db():
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(SQLModel.metadata.create_all)
|
||||
Reference in new issue
Block a user