def insert(self):
        assert not self.exists, "Cannot insert existing report"

        self.env.log.debug("Creating new report '%s'", self.id)
        with self.env.db_transaction as db:
            cursor = db.cursor()
            cursor.execute("""
                INSERT INTO report (title,query,description) VALUES (%s,%s,%s)
                """, (self.title, self.query, self.description))
            self.id = db.get_last_id(cursor, 'report')
Insert a new report.
dataset/ETHPy150Open edgewall/trac/trac/ticket/model.py/Report.insert