def insert_hit_group_status(self, data):
        self.curr.execute('''
            INSERT INTO main_hitgroupstatus (
                crawl_id, inpage_position, hit_group_content_id, page_number,
                group_id, hits_available, hit_expiration_date
            )
            VALUES (
                %(crawl_id)s, %(inpage_position)s, %(hit_group_content_id)s,
                %(page_number)s, %(group_id)s, %(hits_available)s,
                %(hit_expiration_date)s
            )''', data)

        self.curr.execute('''
            UPDATE main_hitgroupcontent
            SET hits_available = %(hits_available)s,
                last_updated = %(now)s
            WHERE id = %(hit_group_content_id)s
        ''', data)

        # add related hitgroupcontent id to index queue
        self.curr.execute('''
            INSERT INTO main_indexqueue (
                hitgroupcontent_id, requester_id, created
            )
            VALUES (
                %(hit_group_content_id)s, %(requester_id)s, now()
            )''', data)
Insert row into main_hitgroupstatus row
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/main/management/commands/crawler/db.py/DB.insert_hit_group_status