I just started using it and it works fine.

First, figure out what identifier you want to use to identify the tenant. 
The Web2py book shows an example that bases it on the URL's sub-domain (ex: 
tenant1.mysite.com, tenant2.mysite.com, etc.). I'm using the "id" field of 
a "shop" table so I have added this Field() to my tables:

Field('request_tenant', default=shop_id, writable=False)

I have code in my model to figure out "shop_id". Something like shop_id = 
db.shop(auth.user.shop_id)

Then, for any query against a table with a request_tenant field, web2py 
automatically adds (db.shop.request_tenant==shop_id) to the query.

Let us know if you have any specific questions.


Reply via email to