Skip to content

Commit 80163a3

Browse files
author
Mark Gibbs
committed
Fix timezones and object extraction when initially populating
1 parent f15a385 commit 80163a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

demo/demo/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
LANGUAGE_CODE = 'en-us'
109109

110-
TIME_ZONE = 'UTC'
110+
TIME_ZONE = 'America/Vancouver'
111111

112112
USE_I18N = True
113113

django_plotly_dash/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DashApp(models.Model):
1414
app_name = models.CharField(max_length=100, blank=False, null=False, unique=False)
1515
instance_name = models.CharField(max_length=100, unique=True, blank=True, null=False)
1616
slug = models.SlugField(max_length=110, unique=True, blank=True)
17-
base_state = models.TextField(null=False) # If mandating postgresql then this could be a JSONField
17+
base_state = models.TextField(null=False, default="{}") # If mandating postgresql then this could be a JSONField
1818
creation = models.DateTimeField(auto_now_add=True)
1919
update = models.DateTimeField(auto_now=True)
2020

@@ -46,7 +46,7 @@ def _get_base_state(self):
4646
'''
4747
Get the base state of the object, as defined by the app.layout code, as a python dict
4848
'''
49-
base_app_inst = self._stateless_dash_app()
49+
base_app_inst = self._stateless_dash_app().as_dash_instance()
5050

5151
# Get base layout response, from a base object
5252
base_resp = base_app_inst.locate_endpoint_function('dash-layout')()

0 commit comments

Comments
 (0)