def save(self, sermon): self.conn = ConnectionFactory().getConnection() cursor = self.conn.cursor() aux_sermon = [sermon.tema, sermon.texto_base] cursor.execute("insert into sermons(tema, texto_base) values(?,?)",aux_sermon) self.conn.commit() self.conn.close()
class SermonDAO(object): ''' classdocs ''' def __init__(self): ''' Constructor ''' def save(self, sermon): self.conn = ConnectionFactory().getConnection() cursor = self.conn.cursor() aux_sermon = [sermon.tema, sermon.texto_base] cursor.execute("insert into sermons(tema, texto_base) values(?,?)",aux_sermon) self.conn.commit() self.conn.close()