Thank you Christian!. It's working now! :)

On Tuesday, May 7, 2013 12:35:51 AM UTC+2, Christian Foster Howes wrote:
>
> to get a GAE projection query you have to specify projection=True in your 
> query:
>
> db(db.auth_user.id==user_role.user_id).select(db.auth_user.first_name, 
> projection=True)
>
> why?  well, for backwards compatibility reasons.  prior to projection 
> queries being supported on GAE the default behavior was to return all 
> columns.  when we added projection support i didn't want to break my 
> existing apps that sometimes list fields, but don't have the projection 
> indexes.
>
> let us know if that doesn't fix it for you!
>
> cfh
>
> On Monday, May 6, 2013 12:17:44 AM UTC-7, José Manuel López wrote:
>>
>> Hi, 
>> I've to make an adHoc user management formulary and I'm making a table 
>> with a "role filter". I'm in GAE and the joins must to be done by hand. 
>> This is my code:
>> auth_user_with_role = db(db.auth_membership.group_id==request.vars.role).
>> select(db.auth_membership.ALL)
>> auth_user_ids_role_selected=db(db.auth_user.id<1).select(db.auth_user.
>> first_name) #This is a Hack, prob I can make it better
>> for user_role in auth_user_with_role:
>>     user = db(db.auth_user.id==user_role.user_id).select(db.auth_user.
>> first_name)
>>     auth_user_ids_role_selected = auth_user_ids_role_selected & user
>>  
>> With this code I have a join between the group table and the user table. 
>> The problem is that in user I have the user with all the columns and not 
>> with only the "first_name" column. Is the  projection not working or am I 
>> doing something wrong?
>> Thank you guy for your help
>>
>

-- 

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