@target_required
    def LogTransactions(self, transaction_list, target_id=None):
        # Create a usable session
        # Initiate urls_list for holding urls and transaction_model_list
        # for holding transaction models
        urls_list = []
        transaction_model_list = []
        # Add transactions and commit so that we can have access to
        # transaction ids etc..
        for transaction in transaction_list:
            # TODO: This shit will go crazy on non-ascii characters
            transaction_model = self.GetTransactionModel(transaction)
            transaction_model.target_id = target_id
            transaction_model_list.append(transaction_model)
            self.db.session.add(transaction_model)
            urls_list.append([transaction.URL, True, transaction.InScope()])
        self.db.session.commit()
        # Now since we have the ids ready, we can process the grep output and
        # add accordingly. So iterate over transactions and their models.
        for i in range(0, len(transaction_list)):
            # Get the transaction and transaction model from their lists
            owtf_transaction = transaction_list[i]
            transaction_model = transaction_model_list[i]
            # Check if grepping is valid for this transaction
            # For grepping to be valid
            # + Transaction must not have a binary response
            # + Transaction must be in scope
            if (not transaction_model.binary_response) and (transaction_model.scope):
                # Get the grep results
                grep_outputs = self.GrepTransaction(owtf_transaction)
                if grep_outputs:  # If valid grep results exist
                    # Iterate over regex_name and regex results
                    for regex_name, regex_results in grep_outputs.iteritems():
                        # Then iterate over the results to store each result in
                        # a seperate row, but also check to avoid duplicate
                        # entries as we have many-to-many relationship
                        # available for linking
                        for match in regex_results:
                            # Conver the match to json
                            match = json.dumps(match)
                            # Fetch if any existing entry
                            existing_grep_output = self.db.session.query(
                                models.GrepOutput).filter_by(
                                    target_id=target_id,
                                    name=regex_name,
                                    output=match).first()
                            if existing_grep_output:
                                existing_grep_output.transactions.append(
                                    transaction_model)
                                self.db.session.merge(existing_grep_output)
                            else:
                                self.db.session.add(models.GrepOutput(
                                    target_id=target_id,
                                    transactions=[transaction_model],
                                    name=regex_name,
                                    output=match))
        self.db.session.commit()
        zest_trans_list = []
        # Append the transaction in the list if recording is set to on
        if self.zest.IsRecording():
            for model in transaction_model_list:
                zest_trans_list.append(model.id)
            self.zest.addtoRecordedTrans(zest_trans_list)
        self.url_manager.ImportProcessedURLs(urls_list, target_id=target_id)
This function does the following things in order
dataset/ETHPy150Open owtf/owtf/framework/db/transaction_manager.py/TransactionManager.LogTransactions