Yea, that did it but I thought the autoload=True should get that from
the existing Table, and not require specification.


On Aug 21, 11:42 am, "Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote:
> Does the User table have a primary key? If not, give it one and it should
> work.
> If it's a view, you'll have to specify the primary key like such:
>
> user_table = Table("User", metadata, Column('uid',Integer(),primary_key=True),
> autoload=True, autoload_with=config['pylons.g'].sa_engine)
>
> On Tuesday 21 August 2007, Anil wrote:
>
>
>
> > I have my table defined as such:
>
> > user_table = Table("User", metadata, autoload=True,
> >     autoload_with=config['pylons.g'].sa_engine)
>
> > Which throws this exception:
>
> > Module entic.controllers.access:74 in _login
> > <<
> >             # select our user
> >             user_q = model.Session.query(model.User)
> >             user = user_q.filter_by(mail=mail, status=1)
> >             h.log(user)
>
> > >>  user_q = model.Session.query(model.User)
>
> > Module sqlalchemy.orm.scoping:68 in do
> > Module sqlalchemy.orm.session:642 in query
> > Module sqlalchemy.orm.mapper:1648 in class_mapper
> > Module sqlalchemy.orm.mapper:236 in compile
> > Module sqlalchemy.orm.mapper:251 in _compile_all
> > Module sqlalchemy.orm.mapper:278 in _do_compile
> > Module sqlalchemy.orm.mapper:446 in _compile_tables
> > <class 'sqlalchemy.exceptions.ArgumentError'>: Could not assemble any
> > primary key columns for mapped table 'User'
>
> > Thanks, for the help.
>
> --
>         UC
>
> --
> Open Source Solutions 4U, LLC   1618 Kelly St
> Phone:  +1 707 568 3056         Santa Rosa, CA 95401
> Cell:   +1 650 302 2405         United States
> Fax:    +1 707 568 6416


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