Update app.py

This commit is contained in:
agsNeto20
2020-11-27 11:31:30 +00:00
committed by GitHub
parent c28263970e
commit 94cd34bb66
+27 -15
View File
@@ -4,20 +4,21 @@ import database
def menu(): def menu():
menu_interface = """-- Netflox -- menu_interface = """-- Netflox --
1) Sign Up. 1) Sign Up
2) Log in. 2) Log in
0) Exit. 0) Exit
Your Selection: """ Your Selection: """
while (user_input := input(menu_interface)) != "0": while (user_input := input(menu_interface)) != '0':
if user_input == "1":
if user_input == '1':
print("Sign up") print("Sign up")
name = input("Enter your name: ") name = input("Enter your name: ")
email = input("Enter your e-mail: ") email = input("Enter your e-mail: ")
password = input("Enter your password: ") password = input("Enter your password: ")
database.create_user(name, email, password) database.create_user(name, email, password)
elif user_input == "2": elif user_input == '2':
print("Log in") print("Log in")
email = input("Enter your e-mail: ") email = input("Enter your e-mail: ")
password = input("Enter your password: ") password = input("Enter your password: ")
@@ -30,26 +31,37 @@ def menu():
def client(): def client():
client_interface = """Welcome client_interface = """
1) Search products. 1) Search products
2) My history. 2) My history
3) Messages. 3) Messages
0) Exit 0) Exit
Your Selection: """ Your Selection: """
while (user_input := input(client_interface)) != "0": while (client_input := input(client_interface)) != '0':
if user_input == "1":
if client_input == '1':
search_interface = """Order by search_interface = """Order by
1) Name 1) Name
2) Actor 2) Actor
3) Director 3) Director
4) Date 4) Date
5) 5) IMDB rating
6) 6) Genre
7) 7) Price
0) Exit
Your Selection: """ Your Selection: """
#range of dates
#range of prices
while (search_input := input(search_interface)) != '0':
if search_input == '1':
name = input("Insert actor name: ")
database.findby_name(name) #doesnt exist yet
menu() menu()
client() client()