Hacker News new | ask | show | jobs
by orf 3609 days ago
Was pretty limited and very very inferior to SQLAlchemy. It still is, but it's bearable.

As an example off the top of my head when I started with Django you couldn't bulk create objects, if you wanted to create 100 records it needed 100 separate INSERT statements. That got old fast.

Edit: Not sure why the downvotes, perhaps comment on why you think I'm wrong?

1 comments

That is true, but it was fixed in Django 1.4... in 2012. Technology moves a bit in 4 years.
Yep, but as I said it's still rather limited compared to SQLAlchemy. Stuff like aggregations are cumbersome, and it's really really easy to shoot yourself in the foot and cause O(n) queries (especially in templates and in custom admin views).

Things specific to Postgres are rather lacking. While they added support for advanced datatypes like arrays, hstore, intervals and search recently (yay!) you still can't use any other index than a standard btree one or things like recursive queries. SQLAlchemy supports all of these, and has done since forever.

Things are progressing, don't get me wrong, but there is a long way to go.

SQLAlchemy has a lot more power than Django's ORM. I'd argue that Django's ORM is more accessible to beginner SQL users though. Django handles joins for you (which admittedly breaks down with very complex queries) which is the only ORM I'm aware of that does. SQLAlchemy maps much more closely to SQL and is a tighter abstraction.

A GSOC project is currently adding customisable indexes: https://groups.google.com/forum/#!topic/django-developers/XA...