class AccountingTransaction(transactions.SQLTransaction): tid = sequences.SequenceIntField(sequence=tid_seq) creation_ts = fields.UTCNowTimestampField() transaction = transactions.SQLTransactionField(TransactionTable) journal_list = transactions.SQLTransactionField(JournalList) def _verify(self): return super()._verify() and sum(self.journal_list.amount) == 0
class FailRecord2(sample_transaction_class): ok_name = fields.IntField() _isolation_level = transactions.SQLTransactionField( sample_table_class)
class QueryTransaction(transactions.SQLTransaction): tid = fields.IntField() total_transaction_count = fields.IntField(query=TransactionCountQuery) row_count = transactions.SQLTransactionField(JournalRowCountResultTID)
class SampleTransaction(transactions.SQLTransaction): trans_id = fields.IntField() special_text = SpecialTextField() view = transactions.SQLTransactionField(sample_view_class) data = transactions.SQLTransactionField(sample_special_table_class)