Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test example #245

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions solidui/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


def create_solidui_app():

return create_app()

@click.group(
Expand Down Expand Up @@ -76,17 +75,16 @@ def version(verbose: bool) -> None:
print("[DB] : " + f"{db.engine}")
print(Style.RESET_ALL)

@solidui.command()
@with_appcontext
def run():

def run_app():
print("测试1")
"""Run the Superset web server."""
app = create_solidui_app()
host = app.config.get("SOLIDUI_WEBSERVER_ADDRESS", "0.0.0.0")
port = app.config.get("SOLIDUI_WEBSERVER_PORT", 8088)
app.run(host=host, port=port)



if __name__ == "__main__":
solidui()
run_app()

1 change: 1 addition & 0 deletions solidui/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
db = SQLA()

stats_logger_manager = BaseStatsLoggerManager()
appbuilder = AppBuilder(update_perms=False)
6 changes: 5 additions & 1 deletion solidui/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
from deprecation import deprecated

import wtforms_json

from solidui.extensions import (
appbuilder
)

if TYPE_CHECKING:
from solidui.app import SolidUIApp
Expand Down Expand Up @@ -61,6 +63,8 @@ def init_views(self) -> None:
models which in turn try to import
the global Flask app
"""
from solidui.views.example import Example
appbuilder.add_api(Example)

def init_app(self) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion solidui/views/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_column_values(
self, datasource_type: str, datasource_id: int, column_name: str
) -> FlaskResponse:
try:
print("测试")
print("测试get_column_values")
except ValueError:
return self.response(
400, message=f"Invalid datasource type: {datasource_type}"
Expand Down
Loading