aliased() not working with subquery in join

Issue #3281 closed
Iurie Gheorghies created an issue
bla = literal_column('1', Integer)

temp = s.query(bla.label('bla')).subquery()
acc = aliased(Account, 'acc')
s.query(acc, temp).join(temp, temp.c.bla == acc.id).all()

raises AttributeError: 'str' object has no attribute 'corresponding_column'

Comments (2)

  1. Mike Bayer repo owner

    I think you mean to say:

    acc = aliased(Account, name='acc')
    

    the second argument is currently called "alias" and is an optional SQL selectable object.

  2. Log in to comment