On May 27, 2009, at 12:23 PM, Nathan Harmston wrote:
Hi,
I have been struggling with trying to create relations which reference
objects a couple of tables away.
e.g
Sentence has many entities
Entity has many NormalisedVersion
NormalisedVersion has one Gene
kind of thing
and was
The problem was solved by using a join query and then specifying both
foreign keys and the secondary argument to the relation.
Many thanks,
Nathan
secondary = sentences_table.join(tag_table.join(processed_tags_table,
processed_tags_table.c.tag_id == tag_table.c.tag_id),
I think I jumped the gun a bit this morning with my excitement.
The results are wrong in that they return all of the identifiers in my
names table.
species_sentences_secondary = sentences_table.join(entities_table,
and_(sentences_table.c.sentence_id == entities_table.c.sentence_id,
On May 18, 2009, at 8:02 PM, Nathan Harmston wrote:
Hi,
I am trying to map a relation in class which allows it to access
objects from a couple of tables away ie.
class Zone(object):
pass
class Sentence(object):
pass
class RawTag(object):
pass
class ProcessedTag(RawTag):
On May 18, 2009, at 8:06 PM, Michael Bayer wrote:
if you want to make a chained join like that, use just primaryjoin(),
dont use secondary, and set viewonly=True.
I might be off on the dont use secondary advice. if you do use
secondary, secondary is the middle table, so in this case it