capsul-flask/capsulflask/model.py

10 lines
282 B
Python
Raw Normal View History

2020-05-10 01:36:14 +00:00
class Model:
def __init__(self, connection, cursor):
self.connection = connection
self.cursor = cursor
def emailExists(self, email):
self.cursor.execute("SELECT * FROM accounts WHERE email = %(email)s", {"email": email})
return len(self.cursor.fetchall()) > 0