Python, Firefox programming and Irish Whiskey.

Thursday, September 2, 2010

seoprofesional toolbar beta

Are you interested in test-driving a new seoprofesional toolbar for firefox, now compatible with FF4? Drop me a note to petrb.feedback+seop110beta@gmail.com.

SQLAlchemy Custom Types

SQLAlchemy is just ingenious. I must admit I haven't worked with any other ORM before, yet SQLAlchemy is more than that. I have been working with it's query language for years (4-5) and just recently I started to tuck into orm. So easy to use and so comprehensive.

If you want to do something related to your database, with SQLAlchemy you probably can. I, for example, need to "modify" a date-time value read from Oracle database backing our ERP. I suspect somebody didn't bother to set-up the timezone information properly. So all I had to do was to subclass types.TypeDecorator and override member function process_result_value to do some magic about my datetime values. That was it (I only read the data so I didn't care about converting back.)