Just do the following in your __init__.py if you are using DBSprockets
(initially Albertos code):

def init_model(engine):
    DBSession.configure(bind=engine) # not really needed if engine is
bound to metadata but anyway...
    metadata.bind = engine # <-- add this if using dbsprockets

For more informartion see
http://groups.google.com/group/dbsprockets/browse_thread/thread/ed794c0a5ca295ed/7ef35cefe9205dee?lnk=st&q=metadata+dbsprockets+alberto#7ef35cefe9205dee

Antti

On 24 syys, 22:50, balisong <[EMAIL PROTECTED]> wrote:
> I have the same problem and i don't know how to manually bind the
> metadata in __init__.py
> can you explain me how to do this please ?
>
> On 10 sep, 17:10, "Mark Ramm" <[EMAIL PROTECTED]> wrote:
>
> > Yea, it seems that issue is the metadata not being bound at the point
> > where make_form tries to introspect the model.
>
> > You may need to "manually" bind the metadata in __init__.py in your
> > model, as is done in a freshly quickstarted project.
>
> > On Wed, Sep 10, 2008 at 9:44 AM, Antti Niinikoski
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Hello list
>
> > > I have a problem with thepasterCRUDtool in TG2. I always get the
> > > following error message:
>
> > > "Exception: arg1(model) has not been mapped to an sql table
> > > appropriately"
>
> > > The exception comes from the make_form method in the form-controller.
> > > The whole traceback can be found in paste (http://paste.turbogears.org/
> > > paste/6318).
>
> > > I have done "pastersetup-app".  And the model works fine without
> > >CRUD. In my project I use the identity and it uses
> > > DeclarativeBase.metadata. Could the metadata be the problem?
>
> > > Does anyone know what I am doing wrong?
>
> > > TheCRUDtool and TG2 seems very intresting. Thanks!
>
> > > Regards,
>
> > > Antti
>
> > --
> > Mark Ramm-Christensen
> > email: mark at compoundthinking dot com
> > blog:www.compoundthinking.com/blog
--~--~---------~--~----~------------~-------~--~----~
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