added target entity

This commit is contained in:
Gardient
2021-09-21 21:23:14 +03:00
parent 8e67a58630
commit aeb8916744
7 changed files with 128 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
from flask import Flask, Blueprint
from . import commands, login, target_exchange
from . import commands, login, target_exchange, target
from .settings import ProdConfig, Config
from .extensions import db, migrate, jwt, apispec
from .exceptions import ApiException
@@ -40,6 +40,8 @@ def register_blueprints(app: Flask):
login.views.blueprint, url_prefix='/login')
api_blueprint.register_blueprint(
target_exchange.views.blueprint, url_prefix='/target-exchange')
api_blueprint.register_blueprint(
target.views.blueprint, url_prefix='/target')
app.register_blueprint(api_blueprint)
@@ -80,7 +82,8 @@ def register_shellcontext(app: Flask):
"""Shell context objects."""
return {
'db': db,
'TargetExchange': target_exchange.models.TargetExchange
'TargetExchange': target_exchange.models.TargetExchange,
'Target': target.models.Target
}
app.shell_context_processor(shell_context)