See my document here:

http://pylonshq.com/project/pylonshq/wiki/SqlAlchemyWithPylons

The QuickWiki way won't work for you.

Best Regards,
-jj

On 3/13/07, C.  Handel <[EMAIL PROTECTED]> wrote:
>
> How do you construct the meta object? is it unbound? I guess so.
> SQLAlchemy can only introspect the database with a bound meta object.
>
> I use a models/metadata.py:
>
> from sqlalchemy import *
> from sqlalchemy.ext.assignmapper import assign_mapper
> from pylons.database import create_engine, session_context
> from paste.deploy import CONFIG
>
> dburi = CONFIG['app_conf']['sqlalchemy.dburi']
>
> meta = BoundMetaData(dburi)
> ctx = session_context
>
>
>
> an my models look like:
>
> from metadata import *
>
> table_stuff = Table('stuff', meta,
>     autoload=True
> )
> ...
>
>
>
> Greetings
>    Christoph
>
>
>
>
> > > Since the database is present anyway and I feel no need to create
> > > it in
> > > websetup.py I decided that I want to simplify the code and use
> > > autoload:
> >
> > > ============================
> > > powerdns_domains_table = Table('domains', meta, autoload=True,
> > >     schema='powerdns')
> > > ============================
> >
> > > Unfortunately that leads to the following exception:
> >
> > > sqlalchemy.exceptions.ArgumentError: Could not assemble any primary
> > > key
> > > columns for mapped table 'domains'
> >
> > > Funnily that error is rotating, too. Every time I reload a page in my
> > > browser I get an exception complaining about one of the other tables I
> > > define.
>
>
> >
>


-- 
http://jjinux.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to