Commit a1dfa9ed authored by Aron Gergely's avatar Aron Gergely

Changed picture file path for shelter pictures

parent 82421138
...@@ -148,7 +148,7 @@ def allshelters(shelter_id=None): ...@@ -148,7 +148,7 @@ def allshelters(shelter_id=None):
result = tree() result = tree()
#shelter pictures folder path #shelter pictures folder path
picpath = 'data/shelters/pictures' picpath = '/public/shelters/pictures'
Supercategory = db.aliased(Category) Supercategory = db.aliased(Category)
...@@ -210,11 +210,11 @@ def allshelters(shelter_id=None): ...@@ -210,11 +210,11 @@ def allshelters(shelter_id=None):
for picture in shelter_pictures: for picture in shelter_pictures:
if picture.is_main_picture == True: if picture.is_main_picture == True:
result[picture.shelter_id]["Identification"]["Cover"] = ["{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["ID"], picture.filename)] result[picture.shelter_id]["Identification"]["Cover"] = ["{}/{}/{}".format(picpath, picture.shelter_id, picture.filename)]
elif not result[picture.shelter_id][picture.name]["Pictures"]: elif not result[picture.shelter_id][picture.name]["Pictures"]:
result[picture.shelter_id][picture.name]["Pictures"] = ["{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["ID"], picture.filename)] result[picture.shelter_id][picture.name]["Pictures"] = ["{}/{}/{}".format(picpath, picture.shelter_id, picture.filename)]
else: else:
result[picture.shelter_id][picture.name]["Pictures"].append("{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["ID"], picture.filename)) result[picture.shelter_id][picture.name]["Pictures"].append("{}/{}/{}".format(picpath, picture.shelter_id, picture.filename))
else: else:
for shelter_property in shelter_properties: for shelter_property in shelter_properties:
...@@ -222,10 +222,10 @@ def allshelters(shelter_id=None): ...@@ -222,10 +222,10 @@ def allshelters(shelter_id=None):
for picture in shelter_pictures: for picture in shelter_pictures:
if picture.is_main_picture == True: if picture.is_main_picture == True:
result[picture.shelter_id]["Identification"]["Cover"] = ["{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["id"], picture.filename)] result[picture.shelter_id]["Identification"]["Cover"] = ["{}/{}/{}".format(picpath, picture.shelter_id, picture.filename)]
elif not result[picture.shelter_id][picture.name]["Pictures"]: elif not result[picture.shelter_id][picture.name]["Pictures"]:
result[picture.shelter_id][picture.name]["Pictures"] = ["{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["id"], picture.filename)] result[picture.shelter_id][picture.name]["Pictures"] = ["{}/{}/{}".format(picpath, picture.shelter_id, picture.filename)]
else: else:
result[picture.shelter_id][picture.name]["Pictures"].append("{}/{}/{}".format(picpath, result[picture.shelter_id]["Identification"]["Attributes"]["id"], picture.filename)) result[picture.shelter_id][picture.name]["Pictures"].append("{}/{}/{}".format(picpath, picture.shelter_id, picture.filename))
return jsonify(result) return jsonify(result)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment