Sunday, May 29, 2011


There are so much things that I want to write down but can't find out a time to do it. Lately my time management seem to be the worst ever. So I'll try to jot down first what in my head and hopefully I can write about it soon.

  • Understanding Django Content Type framework - I've been working on application that require me to use Django's Content Type framework (at least I decided to use contenttype to accomplish the task). Along the way I started to understand how Django implemented it. Content type concept not really unfamiliar to me since Drupal also using the concept for their Information Archictecture (IA). Django Content Type however seem much more flexible (compared to pre Drupal 7) and simpler to understand (compared to Drupal 7 similar concept).
  • Using Django's haystack app for search in your website/application - I decided to use haystack to provide search in another application I've developing and quite excited to see how simpler and fast I can get search working through haystack. I used whoosh for the search backend since the application not that big and will be used by just a number of users so performance not that important.
  • Look into buildbot or jenkins - I need to pick up a topic for our next company meetup in Pycon Sg next week. It can be any topic of my interest so long as it can still benefited the whole team in the presentation. I'm still not decided but topic on automated testing/continuous integration maybe what I'm heading up to.
  • Sqlalchemy - I used sqlalchemy in of my migration script and need to jot down how to get started quick plus some of the concept such as the Session that I started to understand. As everybody know, sqlalchemy is a very huge library and documentation span over few hundred pages I guess. Always lost in the documentation whenever I need to use it.

On another note, would be going to Pycon Sg next week. This would be my first experience with Pycon, hopefully can learn lot of things along the way.

Wednesday, May 25, 2011

Django transaction.commit_manually mask uncaught exception

Update 2012-08-27
I've created a wrapper to the decorator that catch, rollback transaction and reraise the exception:-

This has happened number of times for me. There's a 3 year old ticket on this actually but since I want to be quick and no time yet to look into the ticket, the solution is to wrap all my function with a decorator that can catch the exception and exit immediately.

I'm doing this in a batch script so what I want is either the script succeed or fail immediately, showing the error. YMMV.