capsul-flask/capsulflask/model.py

10 lines
282 B
Python

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