mypy w/ burnettk

This commit is contained in:
jasquat 2022-06-30 11:26:59 -04:00
parent ab83f4feea
commit c5b5670794
3 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import flask.app
import flask.json
from flask_cors import CORS # type: ignore
from flask_mail import Mail # type: ignore
from typing import Any
import spiffworkflow_backend.load_database_models # noqa: F401
from spiffworkflow_backend.config import setup_config
@ -21,7 +22,7 @@ from spiffworkflow_backend.routes.user_blueprint import user_blueprint
class MyJSONEncoder(flask.json.JSONEncoder):
"""MyJSONEncoder."""
def default(self, obj):
def default(self, obj: Any) -> Any:
"""Default."""
if hasattr(obj, "serialized"):
return obj.serialized

View File

@ -6,7 +6,7 @@ from flask_bpmn.models.db import db
from flask_bpmn.models.db import SpiffworkflowBaseDBModel
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.orm import RelationshipProperty, relationship
from spiffworkflow_backend.models.principal import PrincipalModel
from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
@ -25,11 +25,11 @@ class ActiveTaskModel(SpiffworkflowBaseDBModel):
form_json: str | None = ""
bpmn_json: str = ""
assigned_principal: PrincipalModel = relationship(PrincipalModel)
assigned_principal: RelationshipProperty[PrincipalModel] = relationship(PrincipalModel)
id: int = db.Column(db.Integer, primary_key=True)
task_id: str = db.Column(db.String(50), nullable=False)
process_instance_id: int = db.Column(
ForeignKey(ProcessInstanceModel.id), nullable=False
ForeignKey(ProcessInstanceModel.id), nullable=False # type: ignore
)
assigned_principal_id: int = db.Column(ForeignKey(PrincipalModel.id))
process_instance_data: str = db.Column(db.Text)

View File

@ -80,7 +80,7 @@ class ProcessInstanceModel(SpiffworkflowBaseDBModel):
"""ProcessInstanceModel."""
__tablename__ = "process_instance"
id = db.Column(db.Integer, primary_key=True)
id: int = db.Column(db.Integer, primary_key=True)
process_model_identifier: str = db.Column(db.String(50), nullable=False, index=True)
process_group_identifier: str = db.Column(db.String(50), nullable=False, index=True)
process_initiator_id: int = db.Column(ForeignKey(UserModel.id), nullable=False)