Django 1.3 Comes Bearing Gifts

Posted by Bryan in Web Development

Django 1.3 was released on the 26th of March! For the full details, see the release notes.

There are a number of great features in the release, though I am only going to comment on two database ORM improvements.

First, you can now configure how cascade deletes happen!  In most cases, deletes are bad, but when you do need it, you need fine-grained control over how it happens. Before 1.3, deletes would cascade by default... very bad! Now, you can specify the foreign key rules on a per-model basis.

I recently created a promotion system for work for mirroring data. Before this feature would perform a delete, I put in checks to ensure orphaned data was dealt with. With this change, I can go back and retrofit the applicable models and how they should respond to delete requests.   

Second, this release now allows you to couple Python context managers with transaction management... a match made in heaven! This update makes so much sense; I am surprised it wasn’t included prior.

One side note though, the {% url %} tag received a necessary upgrade to conform to a better syntax. It will be very painful to go back and retrofit!

I will be upgrading shortly after the first maintenance release. A big thanks goes out to the Django developer community!