I have the following entities:

class Responder(Entity):
    cleavage_values = OneToMany('CleavageValue')

class CleavageValue(Entity):
    cleavage = ManyToOne('Cleavage', colname='cleavage_id',
                              onupdate='CASCADE',
                              ondelete='CASCADE',
                              primary_key=True)
    responder = ManyToOne('Responder', colname='responder_id',
                              onupdate='CASCADE',
                              ondelete='CASCADE',
                              primary_key=True)

class Cleavage(Entity):
    ...

class SpiderCleavage(Cleavage):
    ...

class MapCleavage(Cleavage):
    ...


is there a simple way to filter the Responder's cleavage_values list
to get only those cleavage_values that belong to a SpiderCleavage?
My idea would be something like that:

responder.cleavage_values.filter(CleavageValue.cleavage.cleavage_id.in
(SpiderCleavage.query.all()))

Cheers,
Lea

--

You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en.


Reply via email to