Commits

Jean-Tiare Le Bigot committed 3493459

enhanced documentation related to _apply_subtransactions

Comments (0)

Files changed (3)

docs/api/transaction.rst

 
     #That's it !
 
-
+Note: In some special "real-World(tm)" situations, it may be necessary to modify
+the behavior of subtransactions. It is possible to overload the method
+:py:meth:`.Transaction._apply_subtransactions` for this purpose. Use case:
+sub-transactions have been automatically/randomly generated by the main transaction
+and the application needs to know wich one were generated or perform some other
+application specific tasks when applying.
 
 Related exceptions
 ==================

docs/raw_api/transactions.rst

 
 .. automethod:: Transaction.save
 
+
 Transactions interface
 ----------------------
 
 
 .. automethod:: Transaction._get_transactors
 
+
+_apply_subtransactions
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. automethod:: Transaction._apply_subtransactions

dynamodb_mapper/transactions.py

         self.status = "running"
 
     def _apply_subtransactions(self):
-        """Run sub-transactions if applicable. This code has been moved to its
-        own method to ease overloading in real-world applications without
-        re-implementing the whole ``commit`` logic.
-        This is called after the main transactors.
+        """Run sub-transactions if applicable. This is called after the main
+        transactors.
+
+        This code has been moved to its own method to ease overloading in
+        real-world applications without re-implementing the whole ``commit``
+        logic.
+
+        This method should *not* be called directly. It may only be overloaded
+        to handle special behaviors like callbacks.
         """
         for subtransaction in self.subtransactions:
             subtransaction.commit()