Sorry Leonel, for the sake of brevity i've just started where the book 
ends. You need to write this before:

db.define_table('blog_post',
Field('subject'),
Field('post_text', 'text'),
Field('is_public', 'boolean'),
common_filter = lambda query: db.blog_post.is_public==True
)

I append now both full Sqls:

SELECT blog_post.id, blog_post.subject, blog_post.post_text, 
blog_post.is_public 
FROM blog_post ORDER BY blog_post.id LIMIT 5 OFFSET 0;

SELECT blog_post.id, blog_post.subject, blog_post.post_text, 
blog_post.is_public 
FROM blog_post WHERE ((blog_post.id IS NOT NULL) AND (blog_post.is_public = 
'T')) ORDER BY blog_post.id LIMIT 5 OFFSET 0;

By the way, i've tested with Sqlite and Mysql and with web2py v2.9.5 and 
v2.9.11.

I agree with Anthony it's worth revisiting this, because one of the aims of 
common filter is security. In the case exposed any user could access the 
whole table.

Regards.


El viernes, 31 de octubre de 2014 19:49:35 UTC+1, Leonel Câmara escribió:
>
> Well the common_filter is on the table and you give it no table.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to