예제 #1
0
파일: Page.py 프로젝트: rebootl/rubric-dyn
    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')
예제 #2
0
파일: Page.py 프로젝트: rebootl/rubric-dyn
    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')