On Jan 25, 2011, at 1:17 AM, Lenza McElrath wrote:
Hey Royce,
This sounds like a job for composite columns:
http://www.sqlalchemy.org/docs/orm/mapper_config.html#composite-column-types
One gotcha that I ran into here is that you cannot have both the component
columns and the composite
Hi does anyone know if is possible to declaratively concatenate two
columns together which you can later do query's on.
E.g. if I wanted to compute a new column course_name made up of
CONCAT(course_code,course_name)
Base = declarative_base()
class Course(Base):
__tablename__ = 'Course'
Hey Royce,
This sounds like a job for composite columns:
http://www.sqlalchemy.org/docs/orm/mapper_config.html#composite-column-types
One gotcha that I ran into here is that you cannot have both the component
columns and the composite column mapped at the same time, like you do in
your example.