def db_update_entry(self): '''update page entry in database, keeping "backward compatible" for now (using all parameters)''' g.db.execute( '''UPDATE entries SET ref = ?, type = ?, title = ?, author = ?, date_norm = ?, time_norm = ?, body_html = ?, body_md = ?, tags = ? WHERE id = ?''', ( self.ref, self.type, self.title, self.author, self.date_norm, self.time_norm, self.body_html, self.body_md, self.tags, self.id ) ) g.db.commit() # write to changelog db_write_change(self.id, 'e')
def db_write_new_entry(self): '''insert new page entry into database, keeping "backward compatible" for now (using all parameters)''' g.db.execute( '''INSERT INTO entries (ref, type, title, author, date_norm, time_norm, body_html, body_md, tags, pub) VALUES (?,?,?,?,?,?,?,?,?,?)''', ( self.ref, self.type, self.title, self.author, self.date_norm, self.time_norm, self.body_html, self.body_md, self.tags, self.pub ) ) g.db.commit() # write to changelog db_write_change(get_latest(), 'n')