Ed Leafe wrote:
> 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

I just wanted to highlight the fact that this commit is potentially dangerous, 
as I 
know you are aware. I don't understand, at first glance at least, why you want 
_fieldStructure to be the same dict for all cursors descended from 
dCursorMixin. 
Doesn't it need to contain the field structure for *this* cursor and not *all* 
cursors?

 >>> bizOrders = self.getBizobj()
 >>> bizLines = bizOrders.bizOpenings
 >>> print bizOrders._CurrentCursor._fieldStructure
{':::select value, typ_ from _prefs where name=?': ()}
 >>> print bizLines._CurrentCursor._fieldStructure
{':::select value, typ_ from _prefs where name=?': ()}
 >>> print id(bizOrders._CurrentCursor._fieldStructure)
26508864
 >>> print id(bizLines._CurrentCursor._fieldStructure)
26508864

Paul


_______________________________________________
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]

Reply via email to