Hey,
I've got two objects which relate to each other with
has_and_belongs_to_many, Person and Group.
I am trying to create a query that will map data between a third
class, Time (Person has_many(times, of_kind="Time")), and Group.
Right now I'm using a query similar to:

secondary_table = Person.mapper.properties["groups"].secondary
query = select([Times.c.time],
              and_(TimeAvailable.c.person_id == Person.c.id,
                   secondary_table.c.people_id == Person.c.id,
                   secondary_table.c.groups_id == group_id_to_find)

But this feels a little ugly and hackish.
Is there a better way to relate these two objects?

Thanks,
David


--~--~---------~--~----~------------~-------~--~----~
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