Changeset 3093
- Timestamp:
- 04/27/07 12:53:21 (2 years ago)
- Files:
-
- trunk/dabo/biz/dBizobj.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/biz/dBizobj.py
r3074 r3093 18 18 19 19 20 def __init__(self, conn , properties=None, *args, **kwargs):20 def __init__(self, conn=None, properties=None, *args, **kwargs): 21 21 """ User code should override beforeInit() and/or afterInit() instead.""" 22 22 self.__att_try_setFieldVal = False … … 32 32 33 33 self._beforeInit() 34 cf = self._cursorFactory = conn 35 if cf: 36 # Base cursor class : the cursor class from the db api 37 self.dbapiCursorClass = cf.getDictCursorClass() 38 39 # If there are any problems in the createCursor process, an 40 # exception will be raised in that method. 41 self.createCursor() 42 34 self.setConnection(conn) 43 35 # We need to make sure the cursor is created *before* the call to 44 36 # initProperties() … … 98 90 99 91 self.beforeInit() 92 93 94 def setConnection(self, conn): 95 """Normally connections are established before bizobj creation, but 96 for those cases where connections are created later, use this method to 97 establish the connection used by the bizobj. 98 """ 99 self._cursorFactory = conn 100 if conn: 101 # Base cursor class : the cursor class from the db api 102 self.dbapiCursorClass = self._cursorFactory.getDictCursorClass() 103 # If there are any problems in the createCursor process, an 104 # exception will be raised in that method. 105 self.createCursor() 100 106 101 107
