On Feb 20, 12:01 pm, "Ali" <aafs...@gmail.com> 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.