Hi,

I have multitenancy application, in my application i have a table called 
countries where i have fields:
id
name
alpha_2_code
alpha_3_code
numeric_code
request_tenant

My loged user has request tenant value of 3 but in my log i see query 
without this condition:
SELECT country.id, country.name, country.alpha_2_code, 
country.alpha_3_code,country
.numeric_code, country.request_tenant FROM country ORDER BY country.id 
LIMIT 30 OFFSET 0;
SELECT count(*) FROM country WHERE ((country.id > 0) AND 
(country.request_tenant 
= '3'));


Count works like it should but regular select doesn't.

This is the code in my controler
@auth.requires_login()
def grid():
    if len(request.args):
        page = int(request.args[0])
    else:
        page = 0

    limit_by = (page * settings["items_per_page"], (page + 1) * settings[
"items_per_page"])
    rows = db().select(db.country.ALL, limitby=limit_by)
    number_of_records = db(db.country.id > 0).count()

    return dict(rows=rows, number_of_records=number_of_records)

What is wrong?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to