insert data in training table
This commit is contained in:
parent
0bf8deff30
commit
d6c3e6b738
12
main.py
12
main.py
@ -63,8 +63,16 @@ def process_gpx_files(tx: Connection, owner: str):
|
|||||||
if gpx_file.creator != 'FitoTrack':
|
if gpx_file.creator != 'FitoTrack':
|
||||||
raise ValueError('gpx file not generated by the FitoTrack app')
|
raise ValueError('gpx file not generated by the FitoTrack app')
|
||||||
training_id = list(db.execute(
|
training_id = list(db.execute(
|
||||||
'insert into training (owner, filename, medium, description) values (:owner, :filename, :medium, :description) returning id',
|
"""insert into training (owner, filename, medium, description, moving_time, stopped_time, moving_distance, stopped_distance) values
|
||||||
(owner, filename, )
|
(?, ?, ?, ?, ?, ?, ?, ?) returning id""",
|
||||||
|
(owner,
|
||||||
|
filename,
|
||||||
|
"",
|
||||||
|
gpx_file.description,
|
||||||
|
gpx_file.get_moving_data().moving_time,
|
||||||
|
gpx_file.get_moving_data().stopped_time,
|
||||||
|
gpx_file.get_moving_data().moving_distance,
|
||||||
|
gpx_file.get_moving_data().stopped_distance,)
|
||||||
))[0][0]
|
))[0][0]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user