Exemple #1
0
def create_bank(bank_name, approval_rule_num_accounts,
                approval_rule_time_months, max_accounts):
    """Create and return a new bank."""

    bank = Bank(bank_name=bank_name,
                approval_rule_num_accounts=approval_rule_num_accounts,
                approval_rule_time_months=approval_rule_time_months,
                max_accounts=max_accounts)

    db.session.add(bank)
    db.session.commit()

    return bank
Exemple #2
0
			user_info = my_bank.selectById(id)
			my_view.printUserInfo(user_info)
		# elif user_input == "4":
			#Take id from user.
			#Check if user exists(Done on login function)
			#If it is a valid user then take in how much to transfer (Done in deposit and withdraw)
			#Check if transfer ammount is less than current balance. (Done in withdraw)
			#If transfer ammount is valid remove that much from your account and add it to the other user's account (Done with deposit and withdraw)
		elif user_input == "5":
			bank_running = False
		else:
			my_view.printOut("Invalid entry. Try again")

my_view = View()

my_bank = Bank()

login_running = True

while login_running == True:
	user_input = my_view.loginMenu()

	if user_input == "1":

		#Run until the user inputs a username that doesnt already exst
		username_while = True
		username = ""
		while username_while == True:
			#Take in potential username
			username = my_view.takeInput("Enter a username: ")
			#Get all users from database