def setTransactions(self, *args, **kwargs):
def transactionid(transaction):<EOL><INDENT>"""<STR_LIT>"""<EOL>try:<EOL><INDENT>return transaction['<STR_LIT>']<EOL><DEDENT>except KeyError as kerr:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>try:<EOL><INDENT>trans = self.mambutransactionsclass(entid=self['<STR_LIT:id>'], *args, **kwargs)<EOL><DEDENT>except AttributeError as ae:<EOL><INDENT>from .mambutransaction import MambuTransactions<EOL>self.mambutransactionsclass = MambuTransactions<EOL>trans = self.mambutransactionsclass(entid=self['<STR_LIT:id>'], *args, **kwargs)<EOL><DEDENT>trans.attrs = sorted(trans.attrs, key=transactionid)<EOL>self['<STR_LIT>'] = trans<EOL>return <NUM_LIT:1><EOL>
Adds the transactions for this loan to a 'transactions' field.

        Transactions are MambuTransaction objects.

        Transactions get sorted by transaction id.

        Returns the number of requests done to Mambu.

.. todo:: since pagination logic was added, is not always true that
          just 1 request was done. It may be more! But since request
          counter singleton holds true information about how many requests
          were done to Mambu, in fact this return value may be obsolete