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

You're right, except for when you need to support multiple database backends. For projects it's usually not a concern, but for libraries it certainly is. The ORM has been slowly adding more and more complex types (Expressions) for more complex use cases, which can be mostly ignored for regular CRUD apps.


Aren't SQL subqueries pretty much standard across all databases anyways? Why would writing them in Django's ORM be more compatible?


Field names, table names, quotes or not - a few examples of things that can differ. The syntax of subqueries themselves are standard AFAIK.

Building subqueries inside Django gives the rest of Django access to them for things like aggregation or filters.




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

Search: