Changeset 3784

Show
Ignore:
Timestamp:
12/11/2007 07:20:50 AM (8 months ago)
Author:
paul
Message:

Filled out documentation of the remaining dBizobj hook methods. See
ticket #1017.

There are still plenty of docstrings to edit or create, but this is
a good start.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/biz/dBizobj.py

    r3774 r3784  
    14821482 
    14831483 
    1484     def _makeHookMethod(name, actionSubject, actionVerb,  mainDoc=None,  
    1485             additionalDoc=None): 
     1484    def _makeHookMethod(name, action,  mainDoc=None, additionalDoc=None): 
    14861485        mode = name[:5] 
    14871486        if mode == "befor": 
    14881487            mode = "before" 
    14891488        if mainDoc is None: 
    1490             mainDoc = "Hook method called %s a %s is %s." % (mode, actionSubject, actionVerb
     1489            mainDoc = "Hook method called %s %s." % (mode, action
    14911490        if additionalDoc is None: 
    14921491            if mode == "before": 
    14931492                additionalDoc =  """Subclasses can put in additional code to run, and/or return a non-empty 
    1494 string to signify that the %s should not be %s. The contents 
    1495 of the string will be displayed to the user.""" % (actionSubject, actionVerb) 
     1493string to signify that the action should not happen. The contents 
     1494of the string will be displayed to the user.""" 
    14961495            else: 
    14971496                additionalDoc = "" 
     
    15061505    ########## Pre-hook interface section ############## 
    15071506 
    1508     beforeNew = _makeHookMethod("beforeNew", "new record", "added") 
    1509     beforeDelete = _makeHookMethod("beforeDelete", "record", "deleted") 
    1510  
    1511     def beforeDeleteAllChildren(self): return "" 
    1512     def beforeFirst(self): return "" 
    1513     def beforePrior(self): return "" 
    1514     def beforeNext(self): return "" 
    1515     def beforeLast(self): return "" 
    1516     def beforeSetRowNumber(self): return "" 
    1517     def beforePointerMove(self): return "" 
    1518     def beforeSave(self): return "" 
    1519     def beforeCancel(self): return "" 
    1520     def beforeRequery(self): return "" 
    1521     def beforeChildRequery(self): return "" 
    1522     def beforeCreateCursor(self): return "" 
     1507    beforeNew = _makeHookMethod("beforeNew", "a new record is added") 
     1508    beforeDelete = _makeHookMethod("beforeDelete", "a record is deleted") 
     1509    beforeFirst = _makeHookMethod("beforeFirst", "navigating to the first record") 
     1510    beforePrior = _makeHookMethod("beforePrior", "navigating to the prior record") 
     1511    beforeNext = _makeHookMethod("beforeNext", "navigating to the next record") 
     1512    beforeFirst = _makeHookMethod("beforeFirst", "navigating to the next record") 
     1513    beforeLast = _makeHookMethod("beforeLast", "navigating to the last record") 
     1514    beforePointerMove = _makeHookMethod("beforePointerMove",  
     1515            "the record pointer moves") 
     1516    beforeDeleteAllChildren = _makeHookMethod("beforeDeleteAllChildren",  
     1517            "all child records are deleted") 
     1518    beforeSetRowNumber = _makeHookMethod("beforeSetRowNumber",  
     1519            "the RowNumber property is set") 
     1520    beforeSave = _makeHookMethod("beforeSave", "the changed records are saved.") 
     1521    beforeCancel = _makeHookMethod("beforeCancel",  
     1522            "the changed records are canceled.") 
     1523    beforeRequery = _makeHookMethod("beforeRequery", "the cursor is requeried") 
     1524    beforeChildRequery = _makeHookMethod("beforeChildRequery", 
     1525            "the child bizobjs are requeried") 
     1526    beforeCreateCursor = _makeHookMethod("beforeCreateCursor",  
     1527            "the underlying cursor object is created") 
    15231528 
    15241529 
    15251530    ########## Post-hook interface section ############## 
    15261531 
    1527     afterNew = _makeHookMethod("afterNew", "new record", "added", 
     1532    afterNew = _makeHookMethod("afterNew", "a new record is added", 
    15281533            additionalDoc = \ 
    15291534"""Use this hook to change field values of newly added records. If 
     
    15321537values and not trigger the memento system, override onNew() instead. 
    15331538""") 
    1534  
    1535     def afterDelete(self): pass 
    1536     def afterDeleteAllChildren(self): return "" 
    1537     def afterFirst(self): pass 
    1538     def afterPrior(self): pass 
    1539     def afterNext(self): pass 
    1540     def afterLast(self): pass 
    1541     def afterSetRowNumber(self): pass 
    1542     def afterPointerMove(self): pass 
    1543     def afterSave(self): pass 
    1544     def afterCancel(self): pass 
    1545     def afterRequery(self): pass 
    1546     def afterChildRequery(self): pass 
    1547     def afterChange(self): pass 
    1548     def afterCreateCursor(self, cursor): pass 
    1549  
     1539    afterDelete = _makeHookMethod("afterDelete", "a record is deleted") 
     1540    afterFirst = _makeHookMethod("afterFirst", "navigating to the first record") 
     1541    afterPrior = _makeHookMethod("afterPrior", "navigating to the prior record") 
     1542    afterNext = _makeHookMethod("afterNext", "navigating to the next record") 
     1543    afterFirst = _makeHookMethod("afterFirst", "navigating to the next record") 
     1544    afterLast = _makeHookMethod("afterLast", "navigating to the last record") 
     1545    afterPointerMove = _makeHookMethod("afterPointerMove",  
     1546            "the record pointer moves") 
     1547    afterDeleteAllChildren = _makeHookMethod("afterDeleteAllChildren",  
     1548            "all child records are deleted") 
     1549    afterSetRowNumber = _makeHookMethod("afterSetRowNumber",  
     1550            "the RowNumber property is set") 
     1551    afterSave = _makeHookMethod("afterSave", "the changed records are saved.") 
     1552    afterCancel = _makeHookMethod("afterCancel",  
     1553            "the changed records are canceled.") 
     1554    afterRequery = _makeHookMethod("afterRequery", "the cursor is requeried") 
     1555    afterChildRequery = _makeHookMethod("afterChildRequery", 
     1556            "the child bizobjs are requeried") 
     1557    afterChange = _makeHookMethod("afterChange", "a record is changed", 
     1558            additionalDoc=\ 
     1559"""This hook will be called after a successful save() or delete(). Contrast 
     1560with the afterSave() hook which only gets called after a save(), and the  
     1561afterDelete() which is only called after a delete().""")     
     1562 
     1563    def afterCreateCursor(self, crs): 
     1564        """This hook is called after the underlying cursor object is created. 
     1565        The crs argument will contain the reference to the newly-created 
     1566        cursor.""" 
    15501567 
    15511568    def _syncWithCursors(self):