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
--
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
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
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
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
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
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
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
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
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
>
10 matches
Mail list logo