Thank villas. I get one more error: http://127.0.0.1:8000/init/appadmin/select/db?query=db.person.id%3E0
Traceback (most recent call last): File "E:\web2py-XDCB\gluon\restricted.py", line 188, in restricted exec ccode in environment File "E:/web2py-XDCB/applications/init/views/appadmin.html", line 161, in <module> <strong>{{="%02d" % ram['oldest'][1]}}</strong> minutes File "E:\web2py-XDCB\gluon\sqlhtml.py", line 1273, in __init__ r = field.represent(r) File "E:\web2py-XDCB\gluon\sql.py", line 518, in <lambda> (ids and ', '.join(f(r,id) for id in ids) or '') TypeError: sequence item 0: expected string, int found On Nov 8, 7:32 pm, villas <villa...@gmail.com> wrote: > Hi toan75, > You have a few problems here. My advice would be to get it working > and then make changes from there, after reading the book. Maybe use > this to begin: > > db.define_table('office', > Field('name','string',length = 128), > Field('description','text'), > Field('pos','integer',default=100)) > > db.define_table('person', > Field('office','list:reference office'), > Field('name','string')) > > I notice that you did not use list:reference in your code. Again, I > would read the book first, there is a section on that in chapter 6. > > Regards, > -D > > On Nov 8, 11:27 am, toan75 <toa...@gmail.com> wrote: > > > > > > > > > It's correct in my model? > > > db.define_table('office', > > Field('name','string',length = 128,requires=ne), > > Field('description','text'), > > Field('pos','integer',default=100)) > > > db.define_table('person', > > Field('office', db.office, requires = IS_IN_DB(db, 'office.id', '% > > (name)s', multiple=True)), > > Field('name')) > > > I'm try insert to > > person:http://127.0.0.1:8000/init/appadmin/insert/db/person > > and get this error: