Pádraig Kitterick

Automatic key generation with App Engine

Posted in Code, Python, Tech, Web, appengine by Pádraig on June 21st, 2008

After playing Google App Engine for a few days, I’ve realised the power that even the basic framework provided by Google, webapp, provides. Working with Python adds a level of flexibility that I never had when working with PHP many years ago (although this was before OO had really infected PHP).

While working on my first real application for app engine I soon came across the problem of creating sensible key names for objects. If you aren’t familiar with the data object models in app engine, each object has a unique key, generated automatically when the object is created, and a key name (property: key_name) which can be specified by the user. The key name can be very useful if you need object identifiers which are human-readable, such as when you use them as part of your apps URLs.

(more…)

Python 2.5 Released

Posted in Code, Python by Pádraig on October 5th, 2006

Okay, I’m a few weeks late catching up with this but Python 2.5 has been released. I’ve been putting off checking it out for a while becuase there are lots of new features to explore (some content free hype about the release if you like that sort of thing). The introduction of a new with statement and a new one-line conditional syntax are particularly welcome.

Windows + Django +svn = Ugh!

Posted in Code, Python, Web by Pádraig on March 19th, 2006

After reinstalling windows recently I once again had to battle with the process of installing Django on Windows XP. All I remember about the last time was several hours of googling (if that isn’t a word ti aught to be) and cursing at the *nix-centric installation notes on the django website. So this time I decided to take notes so that I could put together a semi-coherent guide to installing Django on windows for development purposes. Here goes… (more…)

Authentication in Django templates

Posted in Code, Python, Web by Pádraig on December 5th, 2005

I recently came across a problem when adding user accounts to a Django application I’m currently working on: I wanted to access information about the current user, e.g. whether they were anonymous or logged in, so that I could display a login message or a link to their homepage respectively. This sounds like a relatively simple thing to accomplish but the problem was that I didn’t want to have to look up the current user’s information in every view method and pass it to the template. Luckily Django provides a way of dealing with this very situation by providing a special template ‘context’. (more…)