dabo Commit
Revision 5210
Date: 2009-05-10 14:38:31 -0700 (Sun, 10 May 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5210
Changed:
U trunk/dabo/biz/dBizobj.py
U trunk/dabo/db/dCursorMixin.py
Log:
Improved the efficiency of the getFields() call. Previously it was being called
repeatedly when it wasn't actually necessary.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2009-05-09 17:44:02 UTC (rev 5209)
+++ trunk/dabo/biz/dBizobj.py 2009-05-10 21:38:31 UTC (rev 5210)
@@ -1929,6 +1929,7 @@
"""This method ensures that the passed cursor's properties
are in sync with this bizobj.
"""
+ crs.KeyField = self._keyField
crs.AutoPopulatePK = self._autoPopulatePK
crs.AutoQuoteNames = self._autoQuoteNames
if self._dataStructure is not None:
@@ -1940,7 +1941,6 @@
crs.UserSQL = self._userSQL
crs.VirtualFields = self._virtualFields
crs.Encoding = self.Encoding
- crs.KeyField = self._keyField
crs.setNonUpdateFields(self._nonUpdateFields)
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2009-05-09 17:44:02 UTC (rev 5209)
+++ trunk/dabo/db/dCursorMixin.py 2009-05-10 21:38:31 UTC (rev 5210)
@@ -19,6 +19,8 @@
class dCursorMixin(dObject):
"""Dabo's cursor class, representing the lowest tier."""
_call_initProperties = False
+ # Make this a class attribute, so that it is shared among all instances
+ _fieldStructure = {}
def __init__(self, sql="", *args, **kwargs):
self._convertStrToUnicode = True
@@ -49,8 +51,6 @@
self._blank = {}
# Flag for indicating NULL default values were set
self._nullDefaults = False
- # Holds the result of getFields() for each table/sql
combination.
- self._fieldStructure = {}
# Writable version of the dbapi 'description' attribute
self.descriptionClean = None
# Last executed sql params
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]