By "both", I mean user and receipt tables On 20 Feb, 17:12, "Ali" <[EMAIL PROTECTED]> wrote: > I left out the fields for brevity of example. They both have an id > column defined as primary keys. > > On 20 Feb, 17:11, "Michael Bayer" <[EMAIL PROTECTED]> wrote: > > > On Feb 20, 12:01 pm, "Ali" <[EMAIL PROTECTED]> wrote: > > > > Here is my code (with other fields removed): > > > > stockreceipt_table = Table('stockreceipt', meta, > > > Column('user_id', Integer, ForeignKey('user.id')), > > > # Cancellation > > > Column('cancelled_user_id', Integer, ForeignKey('user.id')), > > > ) > > > > class Receipt(object): > > > """Stock Receipt""" > > > > assign_mapper(ctx, Receipt, stockreceipt_table, > > > properties=dict( > > > user=relation(User, backref='receipts', > > > primaryjoin=stockreceipt_table.c.user_id == > > > users_table.c.id), > > > cancelled_user=relation(User, backref='cancelled_receipts', > > > lazy=False, > > > primaryjoin=stockreceipt_table.c.cancelled_user_id == > > > users_table.c.id), > > > ) > > > that cant be right, since theres no primary key expressed either in > > the stockreceipt_table or in your Receipt mapper.
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---