> ok. So this time I am trying to get data from my widget from > database that has two compound keys, using assign_mapper. > #Initialize: > User_table = sqlalchemy.Table('User', metadata, autoload=True) > class User(object): > pass > usermapper=assign_mapper(session.context,User,user_table) > > #get my record: > x=model.User.get(343,2) > > Why do I get an error? What am I doing wrong here? > > File "/home/lucas/web/tg/quote/quote/controllers.py", line 126, in > upddriver x=model.Bdriver.get(343,2) > File > "/usr/lib/python2.4/site-packages/sqlalchemy/ext/assignmapper.py", > line 7, in do > return getattr(query, name)(*args, **kwargs) > TypeError: get() takes exactly 2 arguments (3 given) u are giving 2 args here, it wants one arg (apart of the self). try give it as tuple .get( (343,2) ), but i'm not sure what is the exact way for composite keys.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---