What is the best way to map several columns from one table to another
table? Let's say I have two classes: LargeComplicatedClass and
AnotherClass.
LargeComplicatedClass which is has a lot of eager loads and columns
with a lot of data, which is expensive to query.
I also have a AnotherClass to which I want to map
LargeComplicatedClass.title columns, so it would be many-to-many
relationship. If I would setup a usual mapper it would look something
like:
mapper(AnotherClass, another_class_table, properties={
'related_large_objects': relation(LargeComplicatedClass,
secondary=...)
})
But that would load the whole LargeComplicatedClass (I can't turn off
eager load for that class, because usually I have to use all its
fields, except for rare cases like this one).
What I need is something like this:
mapper(AnotherClass, another_class_table, properties={
'related_large_titles': customwhateverrelation
([large_complicated_table.c.title], secondary=...)
})
It is similar to column_property, except that this would be a many-to-
many relation.
Does that make sense? Or maybe I've missed some point?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.