#24 __connection__.style unusefull

closed-works-for-me
nobody
None
5
2004-08-18
2004-05-14
Anonymous
No

if we specifiy __connection__.style is our module, the
value is not taken for module SQLObject classes.
MySqLObject._style is initialized in
MetaSQLObject.__new__ function. This function is called
2 times. The first time when importing SQLObject
module, and the second time when creating MySqlObject.
MySqlObject._connection is set only the second time the
function is called. However, the MySqlObject._style is
set the first time it's called, because of this code:

if not newClass._style:
if newClass._connection and
newClass._connection.style:
newClass._style =
newClass._connection.style
else:
newClass._style = Style.defaultStyle

so it never take the __connection__.style value

PS: I'm using the 0.5.2 version.

Discussion

  • Ian Bicking
    Ian Bicking
    2004-08-18

    Logged In: YES
    user_id=210337

    I don't believe this is a problem anymore in the svn
    release, but I'm not entirely sure.

     
  • Ian Bicking
    Ian Bicking
    2004-08-18

    • status: open --> closed-works-for-me