Main

April 11, 2007

Map My Adventure relaunch

As you may remember, we launched MapMyAdventure in February for STA Travel. The application was written in PHP and Javascript. We’d inherited it from another development team, hence the PHP, which obviously isn’t a technology we’d generally choose to use.

The application required some significant enhancements to the back end CMS (which you can’t see as a user), and we took the decision to rebuild the entire server component in TurboGears. This worked out really well, with over 15,000 lines of PHP rewritten as around 5,000 lines of Python, including unit tests, in a few weeks. It was a pretty painless process, with a much more stable and flexible codebase in place. We left the Javascript largely untouched.

I’ll namecheck some of the other components too, all of which did a great job: SQLAlchemy, Elixir, Genshi, lxml, geopy and our own TGNewTraversal.

In the process we added a bunch of back end features, and made a few changes to the front end. The important thing is that we’ve now got a stable platform to extend and enhance, and to roll out for new countries. Watch this space, this is a really exciting project and I think it’s going to go a long way.

February 28, 2007

TGNewTraversal: less broken traversal for TurboGears

I have been massive underwhelmed by the traversal mechanism of CherryPy, which is used in TurboGears.

If you are building a large complex application, you need a lot of control over traversal, and CherryPy just doesn’t give you this. URL components have to be fixed for the normal traversal mechanisms to work. If you want them to be variable, then you need to write some pretty hairy code that depends a lot on CherryPy internals.

In my view this is the major failing in the application, which is otherwise pretty nice. I’ll moan about the lack of daemonisation another time ;)

The other major option is to use Routes. This is lifted from Rails. I gave this a go, but I really dislike pretty much everything about it — I don’t think regular expressions are part of the mix to solve an architectural problem like this.

So, enter TGNewTraversal. I’ve ripped off some of the code from Nevow’s traversal mechanism, which is the best I’ve seen anywhere. I’ve tweaked this slightly to be more friendly in the CherryPy environment. The tiny amount of code required is a testimony to the quality of the traversal concept from Nevow.

It’s working very well on a development project I’m working on right now, and seems ready for an Alpha release at least. It’s released under a BSD license and is in the Cheese Shop. Please give it a shot and let me know what you think.

April 06, 2006

Getting organised with Turbogears

As with all software that changes rapidly, you need some sort of plan for how to manage change to it. Here’s how we manage Turbogears sites in such a way that we can easily deploy sites and manage changes to the codebase not only of our site, but changes to TG.

Continue reading "Getting organised with Turbogears" »