The best of all worlds

Published: August 29, 2006. Filed under: Django.

Every once in a while, someone will complain on the Django users mailing list that they feel our ORM doesn’t offer all the features they need, and it’s true that there are a few exotic and/or advanced things that it can’t handle. Usually the standard people compare to is SQLAlchemy which can be, unfortunately, extremely complex to learn and use. A related — and inaccurate — complaint is that it’s possible to use Django with SQLAlchemy, but that you’d lose the admin app (you wouldn’t; using the admin while your own views rely on another ORM, or even another framework entirely, is actually pretty easy).

Either way, both complaints are about to go out the window: a new Django branch, created literally about an hour ago, will add official support for SQLAlchemy as a ‘contrib’ option. According to the plans laid out by Adrian and Robin, the SQLAlchemy compatibility layer will live in django.contrib.sqlalchemy, and you’ll be able to easily choose which ORM your applications use.

Given the increasing popularity of both Django and SQLAlchemy (which I wouldn’t be surprised to see become the gold standard of Python ORMs), I think this is a big win for everybody.