Perfect.  Thanks, don't know how I missed that one.

-Jim

On Friday, November 29, 2013 1:20:13 PM UTC-6, Niphlod wrote:
>
> use the field_id argument
>
> On Friday, November 29, 2013 8:12:53 PM UTC+1, Jim S wrote:
>>
>> I have the following code:
>>
>>     #  Build query
>>     queries = []
>>     if searchText and searchText.strip() != '':
>>         queries.append((db.auth_group.role.contains(searchText)) |
>>                        (db.auth_user.firstLast.contains(searchText)) |
>>                        (db.auth_user.lastFirst.contains(searchText)))
>>
>>
>>     queries.append(db.auth_membership.id > 0)
>>     query = reduce(lambda a, b: (a & b), queries)
>>
>>
>>     orderby = [db.auth_group.role]
>>
>>
>>     left = [db.auth_group.on(db.auth_membership.group_id == db.auth_group
>> .id),
>>             db.auth_user.on(db.auth_membership.user_id == db.auth_user.id
>> )]
>>
>>
>>     db.auth_membership.id.readable = False
>>
>>
>>     grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
>>                         create=create, details=details, left=left,
>>                         editable=editable, deletable=deletable,
>>                         csv=False, search_widget=defaultSearch,
>>                         paginate=15, maxtextlength=45)
>>
>>
>>
>> If my searchText has a value and I filter the query by that value, when I 
>> add a record or edit a record using the grid, it add/edits the auth_user 
>> table instead of auth_membership like I want it to.  If I don't have a 
>> value in searchText, then it add/edits the auth_membership table as 
>> expected.
>>
>> Any pointers on how to get it to add/edit the auth_membership table all 
>> the time?
>>
>> -Jim
>>
>>

-- 
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.

Reply via email to