from .models import * from server.abstract_api import ApiError, register_api_object from flask import Flask def attach_to_flask(app: Flask): @app.errorhandler(ApiError) def handle_api_error(err: ApiError): return err.to_response() # register these as api accessible register_api_object(app, Person) register_api_object(app, Event) register_api_object(app, Place) register_api_object(app, Image) register_api_object(app, VisitRel)