Is there any way to get SQLAlchemy to only load specific columns through a relationship()?
For example, with this scenario:
class Parent(Base):
__tablename__ = 'parent'
id = Column(Integer, primary_key=True)
children = relationship("Child", lazy='joined')
class Child(Base):
__tablename__ = 'child'
id = Column(Integer, primary_key=True)
parent_id = Column(Integer, ForeignKey('parent.id')) cheap_column = Column(Unicode(10))
expensive_column = Column(LargeBinary)
I'd like Child to get lazily joined when Parent is loaded, but only with Child's "cheap_column" and not it's "expensive_column".
Thanks,
Seth