diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a4acc5a7..1d351fe10e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Support for "Clientside Callbacks" - an escape hatch to execute your callbacks in JavaScript instead of Python [#672](https://github.com/plotly/dash/pull/672) - Added `dev_tools_ui` config flag in `app.run_server` (serialized in ` ''' - class CustomDash(dash.Dash): + class CustomDash(Dash): def interpolate_index(self, **kwargs): return ''' @@ -824,7 +920,7 @@ def update_output(value): self.percy_snapshot(name='request-hooks interpolated') def test_modified_response(self): - app = dash.Dash(__name__) + app = Dash(__name__) app.layout = html.Div([ dcc.Input(id='input', value='ab'), html.Div(id='output') @@ -832,7 +928,7 @@ def test_modified_response(self): @app.callback(Output('output', 'children'), [Input('input', 'value')]) def update_output(value): - dash.callback_context.response.set_cookie( + callback_context.response.set_cookie( 'dash cookie', value + ' - cookie') return value + ' - output' @@ -850,7 +946,7 @@ def update_output(value): assert_clean_console(self) def test_late_component_register(self): - app = dash.Dash() + app = Dash() app.layout = html.Div([ html.Button('Click me to put a dcc ', id='btn-insert'), @@ -874,7 +970,7 @@ def update_output(value): self.wait_for_element_by_css_selector('#inserted-input') def test_output_input_invalid_callback(self): - app = dash.Dash(__name__) + app = Dash(__name__) app.layout = html.Div([ html.Div('child', id='input-output'), html.Div(id='out') @@ -905,7 +1001,7 @@ def failure2(children): ) def test_callback_return_validation(self): - app = dash.Dash(__name__) + app = Dash(__name__) app.layout = html.Div([ html.Div(id='a'), html.Div(id='b'), @@ -942,7 +1038,7 @@ def multi2(a): multi2('aaa') def test_callback_context(self): - app = dash.Dash(__name__) + app = Dash(__name__) btns = ['btn-{}'.format(x) for x in range(1, 6)] @@ -956,9 +1052,9 @@ def test_callback_context(self): @app.callback(Output('output', 'children'), [Input(x, 'n_clicks') for x in btns]) def on_click(*args): - if not dash.callback_context.triggered: + if not callback_context.triggered: raise PreventUpdate - trigger = dash.callback_context.triggered[0] + trigger = callback_context.triggered[0] return 'Just clicked {} for the {} time!'.format( trigger['prop_id'].split('.')[0], trigger['value'] ) @@ -982,4 +1078,4 @@ def on_click(*args): def test_no_callback_context(self): for attr in ['inputs', 'states', 'triggered', 'response']: with self.assertRaises(MissingCallbackContextException): - getattr(dash.callback_context, attr) + getattr(callback_context, attr)