This trick is web2py related, but I love the core of it so much I think it's worth sharing:
db._common_fields.append(Field('request_tenant', default=request.env.http_host,readable=False, writable=False))
This line adds a field 'requesttenant' to every database table declared using pyDAL afterwards on that db connection. On each crud operation through pyDAL on that connection it will only work on records which have the defaulttenant set to the default value. In effect, you've just patched up your web app to be available under different domain names without conflicting with each other.