added trace output and fixed a bug when saving shipcalls without times
This commit is contained in:
parent
c3f8759c70
commit
adaef94854
@ -218,6 +218,8 @@ class SQLHandler():
|
|||||||
|
|
||||||
def get_times_of_shipcall(self, shipcall)->pd.DataFrame:
|
def get_times_of_shipcall(self, shipcall)->pd.DataFrame:
|
||||||
df_times = self.df_dict.get('times') # -> pd.DataFrame
|
df_times = self.df_dict.get('times') # -> pd.DataFrame
|
||||||
|
if df_times is None:
|
||||||
|
return None
|
||||||
df_times = df_times.loc[df_times["shipcall_id"]==shipcall.id]
|
df_times = df_times.loc[df_times["shipcall_id"]==shipcall.id]
|
||||||
return df_times
|
return df_times
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import traceback
|
||||||
import pydapper
|
import pydapper
|
||||||
|
|
||||||
from ..schemas import model
|
from ..schemas import model
|
||||||
@ -36,6 +36,7 @@ def GetShipcalls(options):
|
|||||||
pooledConnection.close()
|
pooledConnection.close()
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
logging.error(traceback.format_exc())
|
||||||
logging.error(ex)
|
logging.error(ex)
|
||||||
print(ex)
|
print(ex)
|
||||||
result = {}
|
result = {}
|
||||||
@ -115,6 +116,7 @@ def PostShipcalls(schemaModel):
|
|||||||
return json.dumps({"id" : new_id}), 201, {'Content-Type': 'application/json; charset=utf-8'}
|
return json.dumps({"id" : new_id}), 201, {'Content-Type': 'application/json; charset=utf-8'}
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
logging.error(traceback.format_exc())
|
||||||
logging.error(ex)
|
logging.error(ex)
|
||||||
print(ex)
|
print(ex)
|
||||||
result = {}
|
result = {}
|
||||||
@ -199,6 +201,7 @@ def PutShipcalls(schemaModel):
|
|||||||
return json.dumps({"id" : schemaModel["id"]}), 200
|
return json.dumps({"id" : schemaModel["id"]}), 200
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
logging.error(traceback.format_exc())
|
||||||
logging.error(ex)
|
logging.error(ex)
|
||||||
print(ex)
|
print(ex)
|
||||||
result = {}
|
result = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user