On Friday 04 December 2009 11:49:01 yuhl wrote:
> > > >  - it is possible to use model and utility code outside of TG, there
> > > > are recipes how to do that.
> > > >
> > > >  - your can *not* use controllers in a CLI (or at least not useful,
> > > > and not without major performance drawbacks). You can't even easily
> > > > import from them.
> > >
> > > not import it... so this is a major drawbacks!
> >
> > Not really. Your controller-classes should be about presentation logic
> > you don't need in the CLI.
>
> This is what I've done
> I've put the logic into a module named admin.py
> admin.py is also used as a CLI.
>
> But each time I use the DBSession within admin.py, I get a  :
> sqlalchemy.exc.UnboundExecutionError: Could not locate a bind
> configured on mapper Mapper|User|tg_user, SQL expression or this
> Session
>
> any idea on how I should do this.

You need to properly set up sqlalchemy of course. This is heavily documented 
in SA itself, and you can have a look at what TG2 does.

Diez

--

You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.


Reply via email to