Posted on December 12, 2008 at 4:59 am

Playing with Django Querysets

I use base36 for all most object ids in tagz. I previously used to manually convert all base36 values into integers before doing the lookups. Yesterday it dawned to me that I could subclass QuerySets and remove a lot of boilerplate code. The idea here is that I can do something like Model.objects.get(pk_base36=’2kk’) instead of something like [...]

Posted on November 4, 2008 at 12:00 pm

Looking for a Job

Due to various reasons beyond the scope of this blog, I’ve had to quit my current job as a Programming Specialist at Position2. So, if you’re looking for a python / django hacker in Bangalore (although telecommuting certainly is an option I’d consider), drop me a line.

Posted on October 1, 2008 at 8:20 pm

Merging Django querysets

This one’s pretty basic (from the docs) , but I end up using it all the times. Being able to “AND” and “OR” django querysets can really simplify a lot of code. Here’s an instance (a simplification of the setup I have in tagz). Lets start by defining 2 models. Now, lets say I want [...]

Posted on August 29, 2008 at 5:59 pm

It is true

My dear brother Thilak met with a minor accident this afternoon, and in the confusion the ensued, he’s spilt the beans on Tagz. It must’ve been painful to singlehandedly type the 228 word post (He’s got a cast on his right hand, because of the accident). The UI is kinda crude, but functional. Actually a [...]

Posted on August 29, 2008 at 4:44 pm

Low level template file caching in Django

In one of my django projects, I use a lot of recursive template tags, which seem to cause quite a bit of slowdown while rendering them. I looked at the code in django.template.loaders.filesystem Looks like the template is reloaded from the filesystem every time the a template is loaded. This gets really bad with custom [...]

Posted on June 26, 2008 at 1:47 pm

Fun with mercurial precommit hooks

I use Mercurial for all my coding projects. Today I hit upon the idea of using mercurial precommit hooks to run django tests before committing. I didn’t really expect it to be so easy I use postgresql on the server, but I found that on win32, running tests with postgresql is excruciatingly slow. For comparison, [...]