Skip to content

Instantly share code, notes, and snippets.

@orf
Created June 16, 2013 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orf/5792914 to your computer and use it in GitHub Desktop.
Save orf/5792914 to your computer and use it in GitHub Desktop.
>>> 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment