Tomas-Wardoloff / Virtual-Wallet

Personal project to spend my time in something more useful rather than playing league of legends
MIT License
0 stars 0 forks source link

Len User Input #7

Open Tomas-Wardoloff opened 1 year ago

Tomas-Wardoloff commented 1 year ago

Every time that a user enters one of the following parameters: Transaction.Description, User.LoginName and User. Password, the function "check_len_user_input" from the file .\src\check_input.py is used. The mentioned function only checks if the length of the input is between 6 and 50 characters when a transaction's description max length is 250 characters.

user_input = input(f"{message}\n• Must be between 6 and 50 characters long\n").strip()
while True:
    if 3 < len(user_input) < 50:
        return user_input
    print("Must be between six and 50 characters long")
    user_input = input(message).strip()
    CREATE TABLE Transactions(
        TransactionId INTEGER PRIMARY KEY AUTOINCREMENT,
        Date DATE,
        Amount DECIMAL(9,2),
        Description VARCHAR(250),
        Type VARCHAR(7),
        UserId INT,
        CategoryId INT,
        FOREIGN KEY(UserId) REFERENCES Users(UserId),
        FOREIGN KEY(CategoryId) REFERENCES Categories(CategoryId)
        );