Detected 2 occurrence(s) of ‘\s*pass[word]+\s*[:=]\s*["'][a-z0-9\-_\!\$]+["']‘: RE `id` = %s;", (id)) res = self.cur.fetchone() self.firstName = res[1] self.lastName = res[2] self.email = res[2] Class UserManager: def __init__(self): self.db = MySQLdb.connect(host="localhost", user="root",passwd="password",db="database") self.cur = self.db.cursor() def get_all_users(self): self.cur.execute("SELECT `id` FROM `user`;") rows = self.cur.fetchall() users = [] for row in rows: users.append(User(row[0])) Source: http://pastebin.com/raw.php?i=Vm5pK2Xd
↧