(self, asset_id, shot_id)
return True
Link asset to the shot
Link asset to the shot
Link asset to the shot
def link_asset(self, asset_id, shot_id):
        """
        Link asset to the shot
        """

        connection = sqlite3.connect(self.SQL_FILE_PATH)
        cursor = connection.cursor()

        # Check if the asset link exists:
        cursor.execute("SELECT * FROM shot_assets WHERE asset_id=:asset_id AND shot_id=:shot_id",

                       {'asset_id': asset_id, 'shot_id': shot_id})

        if cursor.fetchone():
            connection.close()
            return

        cursor.execute("INSERT INTO shot_assets VALUES ("
                       ":id,"
                       ":shot_id,"
                       ":asset_id)",

                       {'id': cursor.lastrowid,
                        'shot_id': shot_id,
                        'asset_id': asset_id})

        connection.commit()
        connection.close()
        return True
def link_asset ( self , asset_id , shot_id ) : connection = sqlite3 . connect ( self . SQL_FILE_PATH ) cursor = connection . cursor ( ) # Check if the asset link exists: cursor . execute ( "SELECT * FROM shot_assets WHERE asset_id=:asset_id AND shot_id=:shot_id" , { 'asset_id' : asset_id , 'shot_id' : shot_id } ) if cursor . fetchone ( ) : connection . close ( ) return cursor . execute ( "INSERT INTO shot_assets VALUES (" ":id," ":shot_id," ":asset_id)" , { 'id' : cursor . lastrowid , 'shot_id' : shot_id , 'asset_id' : asset_id } ) connection . commit ( ) connection . close ( ) return True