From: David M. C. <da...@da...> - 2005-04-04 14:10:53
|
I tried the new selectBy object feature. Unfortunately, while the code for this is there, a return at the top of the dbconnection.DBAPI._SO_columnClause method means it never runs. Well, I never liked that code anyway, so here's a new patch: http://myturl.com/001Ab Dave Cook |
From: Oleg B. <ph...@ph...> - 2005-04-04 19:32:02
|
On Mon, Apr 04, 2005 at 07:10:44AM -0700, David M. Cook wrote: > http://myturl.com/001Ab Which one of those two should I look at? Can you remove the excessive one? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: David M. C. <da...@da...> - 2005-04-06 16:29:21
|
On Mon, Apr 04, 2005 at 11:31:57PM +0400, Oleg Broytmann wrote: > Which one of those two should I look at? Can you remove the excessive > one? Done. I also modified the patch so passing in an id is handled as suggested by Viktor Ferenczi. Dave Cook |
From: Scott R. <sc...@to...> - 2005-04-07 15:03:41
|
How do your apps store and retrieve your connection info? (I assume I'm not the only one that does not like to store passwords into my SCM, nor dig through code to change them.) What I do sometimes: --- ### dbconfig.py global_connection = connectionForURI(...connection stuff...) ### obj.py from SQLObject import SQLObject from dbconfig import global_connection __connection__ = global_connection class myObj(SQLObject): title = StringCol(length=30) --- This is pretty simple, but probably not optimal, and doesn't allow for centralized configuration - I wind up with lots of dbconfig.py files scattered with passwords lying around where people could potentially see them. There are lots of "better" options - what do you all do? - Scott |
From: Ian B. <ia...@co...> - 2005-04-07 16:19:17
|
Scott Russell wrote: > How do your apps store and retrieve your connection info? (I assume I'm > not the only one that does not like to store passwords into my SCM, nor > dig through code to change them.) > > What I do sometimes: > --- > ### dbconfig.py > global_connection = connectionForURI(...connection stuff...) > > ### obj.py > from SQLObject import SQLObject > from dbconfig import global_connection > __connection__ = global_connection > > class myObj(SQLObject): > title = StringCol(length=30) > --- > > This is pretty simple, but probably not optimal, and doesn't allow for > centralized configuration - I wind up with lots of dbconfig.py files > scattered with passwords lying around where people could potentially see > them. There are lots of "better" options - what do you all do? A new feature in SVN addresses this. You don't have to define anything alongside your SQLObject classes, but somewhere (maybe in an __init__.py) do something like: import sqlobject sqlobject.sqlhub.processConnection = connectionForURI(...) That globally effects all SQLObject classes, unless you do: specialhub = sqlobject.dbconnection.ConnectionHub() class MySpecialDBClass(SQLObject): _connection = specialhub -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Oleg B. <ph...@ph...> - 2005-04-08 10:43:08
|
On Wed, Apr 06, 2005 at 09:29:12AM -0700, David M. Cook wrote: > Done. I also modified the patch so passing in an id is handled as suggested > by Viktor Ferenczi. The handling of id column is slightly wrong. Do not use 'id' name verbatim - use soClass.idName instead. Can you also provide a test case(s) to show what you want to achive, to document, to give an example, to test that the patch really achives what you want? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: David M. C. <da...@da...> - 2005-04-08 17:04:14
|
On Fri, Apr 08, 2005 at 02:42:26PM +0400, Oleg Broytmann wrote: > The handling of id column is slightly wrong. Do not use 'id' name > verbatim - use soClass.idName instead. Doh! New patch uploaded. > Can you also provide a test case(s) to show what you want to achive, > to document, to give an example, to test that the patch really achives > what you want? Wrote a simple test, though it doesn't conform to the format in the tests directory. Dave Cook |
From: Oleg B. <ph...@ph...> - 2005-04-08 17:14:30
|
On Fri, Apr 08, 2005 at 10:04:05AM -0700, David M. Cook wrote: > Wrote a simple test, I'll look at it... > it doesn't conform to the format in the tests > directory. No problem, I can convert them to the test framework. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2005-04-11 12:01:00
|
On Fri, Apr 08, 2005 at 10:04:05AM -0700, David M. Cook wrote: > Wrote a simple test, though it doesn't conform to the format in the tests > directory. Now when I see the test... Do I understand it right that the only point of the patch is to to .selectBy(foreignKey=value) instead of .selectBy(foreignKeyID=value) or .selectBy("foreignKey_id"=value)? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: David M. C. <da...@da...> - 2005-04-11 18:48:51
|
On Mon, Apr 11, 2005 at 04:00:43PM +0400, Oleg Broytmann wrote: > On Fri, Apr 08, 2005 at 10:04:05AM -0700, David M. Cook wrote: > > Wrote a simple test, though it doesn't conform to the format in the tests > > directory. > > Now when I see the test... Do I understand it right that the only > point of the patch is to to .selectBy(foreignKey=value) instead of > .selectBy(foreignKeyID=value) or .selectBy("foreignKey_id"=value)? That's what the patch does, but it's actually a bug fix. See the last feature listed in News: http://www.sqlobject.org/docs/News.html#sqlobject-0-6-1 As I said in my original post, the original patch was applied in such a way that that code branch was never actually taken. Dave Cook |
From: Oleg B. <ph...@ma...> - 2005-04-11 19:39:18
|
On Mon, Apr 11, 2005 at 11:48:41AM -0700, David M. Cook wrote: > On Mon, Apr 11, 2005 at 04:00:43PM +0400, Oleg Broytmann wrote: > > Now when I see the test... Do I understand it right that the only > > point of the patch is to to .selectBy(foreignKey=value) instead of > > .selectBy(foreignKeyID=value) or .selectBy("foreignKey_id"=value)? > > That's what the patch does, but it's actually a bug fix. See the last > feature listed in News: > > http://www.sqlobject.org/docs/News.html#sqlobject-0-6-1 > > As I said in my original post, the original patch was applied in such a way > that that code branch was never actually taken. Ok, finally I grok it. Applied at revision 721. Thank you! I've converted your test (look, how useful tests are!) to the test framework and fixed your sqlmeta, if you don't mind. The new unofficial tarball is at http://phd.pp.ru/Software/Python/misc/SQLObject/ Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |