trying to convert bulletin to new db system.
This commit is contained in:
@@ -5,6 +5,7 @@ from pydantic import BaseModel, Field, constr
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import transaction
|
import transaction
|
||||||
from persistent.list import PersistentList
|
from persistent.list import PersistentList
|
||||||
|
from ZODB.Connection import Connection
|
||||||
|
|
||||||
from ..database import DbDependency, TransactionDependency
|
from ..database import DbDependency, TransactionDependency
|
||||||
from ..dependencies import get_current_http_user
|
from ..dependencies import get_current_http_user
|
||||||
@@ -21,9 +22,8 @@ html_router = APIRouter(tags=["bulletins-html"])
|
|||||||
|
|
||||||
# --- API Endpoints ---
|
# --- API Endpoints ---
|
||||||
|
|
||||||
async def list_bulletins(, limit: int = 50, since: Optional[datetime] = None) -> dict:
|
async def list_bulletins(connection: Connection, limit: int = 50, since: Optional[datetime] = None) -> dict:
|
||||||
with trans as conn:
|
root = connection.root()
|
||||||
root = conn.root()
|
|
||||||
bulletins_list: List[Bulletin] = root.get("bulletins", [])
|
bulletins_list: List[Bulletin] = root.get("bulletins", [])
|
||||||
|
|
||||||
# Newest first
|
# Newest first
|
||||||
|
|||||||
Reference in New Issue
Block a user