Skip to content

Commit

Permalink
Update database.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Jan 2, 2025
1 parent 97344eb commit 5708168
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions OpenOversight/app/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
from flask_login import UserMixin
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import CheckConstraint, UniqueConstraint, func
from sqlalchemy.orm import DeclarativeMeta, declarative_mixin, declared_attr, validates
from sqlalchemy.orm import (
DeclarativeBase,
MappedAsDataclass,
declarative_mixin,
declared_attr,
validates,
)
from sqlalchemy.sql import func as sql_func
from werkzeug.security import check_password_hash, generate_password_hash

Expand All @@ -34,7 +40,10 @@

db = SQLAlchemy()
jwt = JsonWebToken(SIGNATURE_ALGORITHM)
BaseModel: DeclarativeMeta = db.Model


class BaseModel(MappedAsDataclass, DeclarativeBase):
"""subclasses will be converted to dataclasses"""


officer_links = db.Table(
Expand Down

0 comments on commit 5708168

Please sign in to comment.