Thanks a lot @Leonel
Regards

On Wed, 6 Mar 2019, 20:37 Maurice Waka <[email protected]> wrote:

> More,
> this works some how:
> db.define_table('weight',
>                 Field('author', 'reference auth_user',
> default=auth.user_id, writable=False, readable=False),
>                 Field('weight','double',),
>                 Field('created_by','reference auth_user',default =
> auth.user_id, readable = False, writable = False),
>                 common_filter = lambda query: db.weight.author ==
> auth.user_id)
>
> On Wed, Mar 6, 2019 at 8:05 PM Leonel Câmara <[email protected]>
> wrote:
>
>> Ok that problem is easily solved by adding common_filter to the weight
>> table
>>
>> db.weight._common_filter = lambda query: db.weight.author == auth.user_id
>>
>> You can also set the common filter in your define_table call if you want
>> to keep the weight table lazy.
>>
>> --
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/tpYcuBypMZk/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/d/optout.

Reply via email to