Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That, and typing "select x from table A, table B where tableA.foreign_key = tableB.index and tableA.index=5" is a little long-winded and more prone to error, when you can just do x = ModelA.objects.get(pk=5).ModelB


SELECT B.x FROM tableA A JOIN tableB B on A.foreign_key = B.index WHERE A.index = 5

That's very simple, if you know SQL.

I think




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: