Try putting the data manip stuff inside of:
yourapp/model/__init__.py
in the:
def init_model(engine):
Put data initialization in here...
On Nov 13, 3:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Thanks for the response! I'll root around and if I find the culprit,
> I'll post my findings back here.
>
> On Nov 12, 5:00 pm, "Mike Orr" <[EMAIL PROTECTED]> wrote:
>
> > On Wed, Nov 12, 2008 at 2:41 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi everyone!
>
> > > I'm diving into Pylons and Tesla for the first time and I'm running
> > > into an issue while querying on any table.
>
> > > Example:
> > > <code>
> > > % paster shell
>
> > >>>> model.Location.query.all()
> > > UnboundExecutionError: Could not locate a bind configured on mapper
> > > Mapper|Location|Location, SQL expression or this Session
> > > </code>
>
> > > I can use this Elixir model just fine outside of Pylons/ Tesla. I'm
> > > guessing I'm not wiring something correctly. Any help would be
> > > _greatly_ appreciated.
>
> > I can tell you what's happening in general, but not specifically
> > what's wrong in the Tesla configuration. Whatever is performing the
> > SQL operation is not providing an Engine or Connection to execute it
> > with, so these two parts of the application are not communicating
> > properly. At the simplest level, you execute statements via
> > 'engine.execute(sql)'. But if you tell a SQL statement or ORM object
> > to execute itself, it looks for an engine/connection in the following
> > order:
>
> > - 'bind' argument to the method
> > - engine bound to the session (set via sessionmaker options), *if* the
> > operation was invoked from a session object
> > - engine bound to the metadata (set via 'metadata.bind = engine' or
> > 'MetaData(engine)'
>
> > If it can't find an engine in any of these, it'll fail with this error.
>
> > --
> > Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---