I gave it a shot but I am no closer to knowing how to do this.
On Nov 19, 12:00 am, Michael Bayer [EMAIL PROTECTED] wrote:
joining to a subquery is better accomplished outside of relation()
using query, such as query(USZipCode).join((subquery,
subquery.c.col==USZipCode.somecol)).
Now
its impossible to know what you want without seeing literal SQL but this
is the general idea
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class USCity(Base):
__tablename__ = 'cities'
id =
joining to a subquery is better accomplished outside of relation()
using query, such as query(USZipCode).join((subquery,
subquery.c.col==USZipCode.somecol)).
Now you want it as an attribute on your class. Do it like this:
class USCity(object):
...
@property
def