Thank you Anthony. Where is it written that represent passes 2 positional
arguments in this way?

2018-01-27 14:26 GMT+01:00 Anthony <[email protected]>:

> On Friday, January 26, 2018 at 2:01:26 PM UTC-5, Andrea Fae' wrote:
>>
>> for me it's worst than before!
>> what is other_table? Why you don't use row? I don't understand...I'm sorry
>>
>
> Python makes a distinction between positional and keyword arguments to
> functions. When web2py calls the represent function, it passes the value of
> the field and the entire Row object as two *positional *arguments (the
> field value as the first argument and the Row object as the second).
> Therefore, it does not matter what you name those arguments when you define
> the function -- call them whatever you want. You can call them "id" and
> "row", "value" and "record", "foo" and "bar", or anything at all. When the
> field in question happens to be a reference field (and therefore stores the
> IDs of records from another table), it is common to call the first argument
> "id" to indicate it is a record ID -- but that is just by convention.
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/EKGhMd6z_vQ/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