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

@@ -18,8 +18,10 @@
import json
from superset import db
from superset.models.dashboard import Dashboard
from superset.models.slice import Slice
from .helpers import Dash, get_slice_json, merge_slice, Slice, TBL, update_slice_ids
from .helpers import get_slice_json, merge_slice, TBL, update_slice_ids
COLOR_RED = {"r": 205, "g": 0, "b": 3, "a": 0.82}
POSITION_JSON = """\
@@ -509,10 +511,10 @@ def load_deck_dash():
print("Creating a dashboard")
title = "deck.gl Demo"
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()
dash.published = True
js = POSITION_JSON
pos = json.loads(js)