def save_to_db(self): with ConnectionFromPool() as conection: with conection.cursor() as cursor: cursor.execute( 'INSERT INTO users (email, first_name, last_name) values (%s,%s,%s)', (self.email, self.first_name, self.last_name))