[SQLObject] Why must SQLObject expose database connections to users's?

2008-05-06 Thread chris
Why does my TurboGears/SQLObject app need an explicit connection to database to be exposed? I'm thinking of the following line which *MUST* appear __connection__ = turbogears.database.PackageHub("myapp") Isn't a goal for ORMs to hide all this database connection stuff? Chris --

[SQLObject] better way to manually commit changes to database....?

2008-05-06 Thread chris
In my TurboGears/SQLObject app, I manually commit changes to the database with a line like the following... MyObject._connection.commit() It works but looks ugly since _connection is "private variable" that should not be accessed right? Chris

Re: [SQLObject] Why must SQLObject expose database connections to users?

2008-05-06 Thread Oleg Broytmann
On Tue, May 06, 2008 at 11:37:55AM -0700, [EMAIL PROTECTED] wrote: > Why does my TurboGears/SQLObject app need an explicit connection to database > to > be exposed? This is like asking why there are constructors in OO programming. The answer for both questions is - because you need to initiali

Re: [SQLObject] Why must SQLObject expose database connections to users?

2008-05-06 Thread chris
Oleg Thank you. See reponses below. On Tue, May 06, 2008 at 10:53:29PM +0400, Oleg Broytmann wrote: > > Isn't a goal for ORMs to hide all this database connection stuff? > >Yes, but remember these things: > > 1. The Law of Leaky Abstractions - it is very hard to completely hide the > underly

Re: [SQLObject] Why must SQLObject expose database connections to users?

2008-05-06 Thread Oleg Broytmann
On Tue, May 06, 2008 at 12:19:05PM -0700, [EMAIL PROTECTED] wrote: > On Tue, May 06, 2008 at 10:53:29PM +0400, Oleg Broytmann wrote: > > > Isn't a goal for ORMs to hide all this database connection stuff? > > 2. There is no way for an ORM to guess where you do want to connect to. > > Yes but could

Re: [SQLObject] better way to manually commit changes to database....?

2008-05-06 Thread Jorge Vargas
On Tue, May 6, 2008 at 2:53 PM, <[EMAIL PROTECTED]> wrote: > In my TurboGears/SQLObject app, I manually commit changes to the database > with a line like the following... > please don't use misleading statements. the only reason you are using it this way is because you are running the changes fro

Re: [SQLObject] Why must SQLObject expose database connections to users's?

2008-05-06 Thread Jorge Vargas
On Tue, May 6, 2008 at 2:37 PM, <[EMAIL PROTECTED]> wrote: > Why does my TurboGears/SQLObject app need an explicit connection to database > to > be exposed? > > I'm thinking of the following line which *MUST* appear > > __connection__ = turbogears.database.PackageHub("myapp") > > Isn't a

Re: [SQLObject] Why must SQLObject expose database connections to users?

2008-05-06 Thread chris
On Tue, May 06, 2008 at 11:48:16PM +0400, Oleg Broytmann wrote: >I usually keep a reference to the connection, so I don't need to extract > it from SQLObjects: > > connection = ... > > class MyTable(SQLObject): >_connection = connection > > connection.commit() Hmm. There seems to be 2 ways

Re: [SQLObject] better way to manually commit changes to database....?

2008-05-06 Thread chris
On Tue, May 06, 2008 at 04:57:50PM -0400, Jorge Vargas wrote: > On Tue, May 6, 2008 at 2:53 PM, <[EMAIL PROTECTED]> wrote: > > In my TurboGears/SQLObject app, I manually commit changes to the database > > with a line like the following... > > > please don't use misleading statements. the only r

Re: [SQLObject] Why must SQLObject expose database connections to users's?

2008-05-06 Thread chris
On Tue, May 06, 2008 at 05:01:28PM -0400, Jorge Vargas wrote: > On Tue, May 6, 2008 at 2:37 PM, <[EMAIL PROTECTED]> wrote: > > Why does my TurboGears/SQLObject app need an explicit connection to > > database to > > be exposed? > > > > I'm thinking of the following line which *MUST* appear >