Private
Public Access
1
0

better api processing (sets duplicate)

This commit is contained in:
Sander Roosendaal
2020-12-31 16:33:55 +01:00
parent 65e580dd92
commit 96b4b641b6
2 changed files with 39 additions and 17 deletions

View File

@@ -296,6 +296,15 @@ def strokedatajson_v2(request,id):
timestr = row.startdatetime.strftime("%Y%m%d-%H%M%S")
csvfilename ='media/Import_'+timestr+'.csv'
workoutdate = row.date
workoutstartdatetime = row.startdatetime
workoutenddatetime = workoutstartdatetime+datetime.timedelta(seconds=data[' ElapsedTime (sec)'].max())
duplicate = dataprep.checkduplicates(r,workoutdate,workoutstartdatetime,workoutenddatetime)
if duplicate:
row.duplicate = True
row.save()
res = data.to_csv(csvfilename+'.gz',index_label='index',
compression='gzip')
row.csvfilename = csvfilename