Edit: Meant to say 'Checking for two values in one element' in the title. I stayed up too late trying to fix this issue, as starts to show by my spelling...
Hi everybody. So I'm writing my first real project in Python (and programming in general!). I'm making a login system.
I would be so grateful to get some help with this issue, since I have to turn in this exam project Tuesday this week. As I mentioned I'm building a simple login system with TinyDB working as the database.
My problem is that I just can't find a way to test whether a username and password matches. I have a database that looks something like this: http://i.imgur.com/7zE55dj.png
My first (perhaps naive) attempt was to do something like:
if db.contains(where("Username") == LoginUsernameTry and where("Password") == LoginPasswordTry):
The major problem that this has is that it result in a successful login if you type user1's username and user2's username. Perhaps I could somehow test the above conditional, only limited to a single eid? I have the eid of the user that you are attempting to log into, called LoginUsernameID.
Sorry for the trouble 🙂