updated DBHelper.
This commit is contained in:
parent
b4b0b33abe
commit
f2ee04a024
1 changed files with 14 additions and 7 deletions
21
DBHelper.py
21
DBHelper.py
|
@ -90,13 +90,20 @@ class DBHelper:
|
||||||
address = user.val()["Address"]
|
address = user.val()["Address"]
|
||||||
return address
|
return address
|
||||||
|
|
||||||
# Uploads the photo, input should be something like "Photos_of_Users/example.png"
|
# Uploads the photo of user, input should be something like "example.png"
|
||||||
# or something like "Photos_of_Thieves/example.png" for the thieves.
|
def uploaduserphoto(userphoto):
|
||||||
def uploadphoto(userphoto):
|
|
||||||
userphoto_str = str(userphoto)
|
userphoto_str = str(userphoto)
|
||||||
storage.child(userphoto_str).put(userphoto)
|
storage.child("Photos_of_Users/" + str(userphoto)).put("Photos_of_Users/" + str(userphoto))
|
||||||
|
|
||||||
# Downloads the photo, input should be something like "Photos_of_Users/example.png"
|
# Uploads the photo of user, input should be something like "example.png"
|
||||||
def downloadphoto(userphoto):
|
def uploadthiefphoto(userphoto):
|
||||||
userphoto_str = str(userphoto)
|
userphoto_str = str(userphoto)
|
||||||
storage.child("Photos_of_Users/" + userphoto_str).download("Storage_from_Database/" + userphoto_str)
|
storage.child("Photos_of_Thieves/" + str(userphoto)).put("Photos_of_Thieves/" + str(userphoto))
|
||||||
|
|
||||||
|
# Downloads all the user photos, input should be something like "example.png"
|
||||||
|
def downloadalluserphotos(self):
|
||||||
|
storage.child("Photos_of_Users").download("Storage_from_Database")
|
||||||
|
|
||||||
|
# Downloads all the thief photos, input should be something like "example.png"
|
||||||
|
def downloadallthiefphotos(self):
|
||||||
|
storage.child("Photos_of_Thieves").download("Storage_from_Thieves")
|
Loading…
Reference in a new issue