2013-03-10 64 views
0

我有2個表。第一個tabel是auth_user,我存儲了一些用戶設置,並且有一個名爲foo的列;它是一個列表,看起來像:選擇查詢的一些問題

row = db().select(db.auth_user.ALL).first() 
print row.foo 
## ['a','b'] 

在第二臺data_table我存儲一些信息,而且它有一個名爲book列。我需要做一個查詢來獲取從data_table信息,其中

data_table.book.lower() in row.foo == True 

這裏是我的代碼:

datab = db((db.data_table.book.lower() in row.foo) == True).select(db.data_table.ALL, limitby=((int(page_number)-1)*50, int(page_number)*50)) 

但它並沒有排序,哪裏是我的錯誤?

回答

0

認真考慮編寫存儲過程的這種事情。