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 <[email protected]> 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:
>