Thanks for your help. After trying your suggestion for a while, I eventually realised that SQLObject was doing something funny in its metaclass that was causing the issue, which I got around by mangling the class names with a counter.