Bugs item #2417338, was opened at 2008-12-11 18:02
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2417338&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Lucian Stanescu (luci_stanescu)
Assigned to: Oleg Broytmann (phd)
Summary: _connection ignored if sqlhub.processConnection set before
Initial Comment:
If sqlhub.processConnection is set before a subclass of SQLObject is defined, then the _connection attribute of the new class will be ignored. This is, as far as I could find out, because of:
sqlobject/main.py:768
if connection and not hasattr(cls, '_connection'):
cls.setConnection(connection)
This creates a lot of confusion and, if I understood correctly, is not the intended behaviour either (citing from the documentation):
"If you have defined sqlhub.processConnection then this attribute can be omitted from your class and the sqlhub will be used instead. If you have several classes using the same connection that might be an advantage, besides saving a lot of typing."
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2008-12-11 18:13
Message:
if connection and not hasattr(cls, '_connection')
means "if there is a global connection and there is no _connection
attribute". So I don't see how SQLObject can ignore _connection - there is
no one.
Can you write a short program that demonstrates the problem?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2417338&group_id=74338
|