dump on demand
This commit is contained in:
3
stand.py
3
stand.py
@ -47,9 +47,6 @@ if not new_df.equals(df) and not changed:
|
||||
restapi.data = df = new_df
|
||||
|
||||
|
||||
restapi.dfh.dump()
|
||||
|
||||
|
||||
print(">>> end of streamlit run")
|
||||
|
||||
|
||||
|
@ -19,7 +19,11 @@ class TableAPI:
|
||||
|
||||
@data.setter
|
||||
def data(self, df):
|
||||
if self.dfh.df.equals(df):
|
||||
print("<<< skipping dump because dataframe did not change")
|
||||
return
|
||||
self.dfh.df = df
|
||||
self.dfh.dump()
|
||||
|
||||
|
||||
def GET(self):
|
||||
@ -30,6 +34,7 @@ class TableAPI:
|
||||
kwargs = kwargs or cp.request.json
|
||||
self.dfh.append(kwargs)
|
||||
self._trigger_changed()
|
||||
self.dfh.dump()
|
||||
return str(self.dfh.df)
|
||||
|
||||
def DELETE(self):
|
||||
|
Reference in New Issue
Block a user