You have to use requires in field definition.

Something like:

db.define_table('yourtable',
                Field('title','string'),
                Field('scheda', 'reference db.scheda',
requires=IS_IN_DB(db, db.scheda.scheda, zero='Select...')
)

Take a look here:
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators?#Database-validators
<http://www.web2py.com/books/default/chapter/29/07/forms-and-validators?search=IS_IN_DB#Links-to-referencing-records>


On Sun, Aug 9, 2015 at 4:03 PM, Alessio Varalta <varalt...@gmail.com> wrote:

> Hi, I have a table with external references my main table is person and
> this has a field called scheda that is a external references to a table
> scheda. If i create a sqlform the field scheda is a input string and the
> user must insert the id of the external references for the form submit
> accept. There is the possibility to create sqlform where the field scheda
> is a list of schede and the user can choose one field that is translate
> like a id, because is not natural for the user insert a id. Now i simulate
> the operation with javascript but is not the solution
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Massimiliano

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to