public
Created

  • Download Gist
gistfile1.py
Python
1 2 3 4 5
>>> print band.members.all().query
SELECT "test_m2m_artist"."id", "test_m2m_artist"."name" FROM "test_m2m_artist" INNER JOIN "test_m2m_band_members" ON ("test_m2m_artist"."id" = "test_m2m_band_members"."artist_id") WHERE "test_m2m_band_members"."band_id" = 1
 
>>> print artist.bands.all().query
SELECT "test_m2m_band"."id", "test_m2m_band"."name" FROM "test_m2m_band" INNER JOIN "test_m2m_band_members" ON ("test_m2m_band"."id" = "test_m2m_band_members"."band_id") WHERE "test_m2m_band_members"."artist_id" = 1

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.