|
|
@ -141,8 +141,6 @@ def export_location(location_id: int) -> bool: |
|
|
|
# flush before query |
|
|
|
# flush before query |
|
|
|
db.session.flush() |
|
|
|
db.session.flush() |
|
|
|
|
|
|
|
|
|
|
|
print(f"Location: {location_id}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Query |
|
|
|
# Query |
|
|
|
loc_query = db.session.query(TLocation).filter(TLocation.id_location == location_id).first() |
|
|
|
loc_query = db.session.query(TLocation).filter(TLocation.id_location == location_id).first() |
|
|
|
|
|
|
|
|
|
|
@ -157,7 +155,6 @@ def export_location(location_id: int) -> bool: |
|
|
|
"comments": [] |
|
|
|
"comments": [] |
|
|
|
} |
|
|
|
} |
|
|
|
for comment in comments: |
|
|
|
for comment in comments: |
|
|
|
print(f"Data: {comment.comments_id}") |
|
|
|
|
|
|
|
bundle['comments'].append(alchemy_query_to_dict(comment)) |
|
|
|
bundle['comments'].append(alchemy_query_to_dict(comment)) |
|
|
|
|
|
|
|
|
|
|
|
path_loc = re_match(".*(?=/)", loc_query.location)[0] |
|
|
|
path_loc = re_match(".*(?=/)", loc_query.location)[0] |
|
|
@ -170,7 +167,6 @@ def export_location(location_id: int) -> bool: |
|
|
|
folder.mkdir(parents=True, exist_ok=True) |
|
|
|
folder.mkdir(parents=True, exist_ok=True) |
|
|
|
with out.open('w') as fp: |
|
|
|
with out.open('w') as fp: |
|
|
|
json.dump(bundle, fp) |
|
|
|
json.dump(bundle, fp) |
|
|
|
print("Bundle here ---------- \n") |
|
|
|
|
|
|
|
print(bundle) |
|
|
|
print(bundle) |
|
|
|
|
|
|
|
|
|
|
|
return True |
|
|
|
return True |
|
|
|