Refactor Dashboard and Slice models (#8820)

* refactor dashboard and slice models

* appease various linters

* remove shortcuts & import indirection

* appease mypy

* fix bad imports

* lint

* address various issues

* ignore type issue

* remove unused imports

* lint
This commit is contained in:
David Aaron Suddjian
2019-12-18 11:40:45 -08:00
committed by Maxime Beauchemin
parent cbf860074b
commit 016f202423
34 changed files with 929 additions and 838 deletions

View File

@@ -19,8 +19,10 @@ import json
import textwrap
from superset import db
from superset.models.dashboard import Dashboard
from superset.models.slice import Slice
from .helpers import Dash, Slice, update_slice_ids
from .helpers import update_slice_ids
def load_tabbed_dashboard(_=False):
@@ -28,10 +30,10 @@ def load_tabbed_dashboard(_=False):
print("Creating a dashboard with nested tabs")
slug = "tabbed_dash"
dash = db.session.query(Dash).filter_by(slug=slug).first()
dash = db.session.query(Dashboard).filter_by(slug=slug).first()
if not dash:
dash = Dash()
dash = Dashboard()
# reuse charts in "World's Bank Data and create
# new dashboard with nested tabs