>
> Assuming different users are adding "projects" to the "t_projects" table
> which is a referenced field in "t_tests" table as below:
> db.define_table('t_tests',
> Field('f_test_name', type='string',
> label=T('Test Name')),
> Field('f_test_project', type='reference t_projects',
> ......
>
> On the SQLFORM of "t_tests", the drop down menu will display all projects
> added by all users.
> Is there a way to filter the list to display my projects only?
>
Field('f_test_project', type='reference t_projects',
requires=IS_IN_DB(db([query goes here]), 't_projects.id', db.
t_projects._format))
You'll have to specify a query to limit the projects to a particular user
(presumably there is an auth_user reference field in t_projects. Also, note
that by explicitly specifying a "requires" argument for the reference
field, you will no longer get a default "represent" attribute, so you'll
need to specify that explicitly as well.
Anthony
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.