relatives = Person.select().where(Person.is_relative == True).alias("relatives_alias")
relative_pets = Pet.select(Pet, relatives).join(relatives, on=(Pet.owner == relatives.c.id))
for p in relative_pets:
print p.name, p.owner.name
--
You received this message because you are subscribed to the Google Groups "peewee-orm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to peewee-orm+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.