I think this is because:

On Mon, Dec 29, 2008 at 3:47 PM, vince <lapcc...@gmail.com> wrote:

>
> this problem exist on 1.54 as well.
>
> if using IS_IN_DB to string field instead of the id field. it will
> have the error after form submit.
>
> db.define_table('name_list',
>    db.Field('name')
>    )
> db.define_table('members',
>   db.Field('name',db.name_list),


'name' is an integer, specifically a foreign key - a reference to
db.name_list.id  (the name_list.id part is implicit).


>
>   )
> db.members.name.requires=IS_IN_DB(db,'name_list.name')
>

this says the foreign key (a 'name_list.id')  must be in the table name_list
in a string field, 'name'.

This is why you get an error - you are checking a foreign key (an integer)
against a string.


>
>
> On Dec 30, 4:24 am, vince <lapcc...@gmail.com> wrote:
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 62, in restricted
> >     exec ccode in environment
> >   File "/home/web2py/applications/cychurch/controllers/appadmin.py",
> > line 209, in <module>
> >   File "gluon/globals.py", line 55, in <lambda>
> >     self._caller=lambda f: f()
> >   File "/home/web2py/applications/cychurch/controllers/appadmin.py",
> > line 197, in update
> >     if form.accepts(request.vars,session):
> >   File "gluon/sqlhtml.py", line 286, in accepts
> >     fields[fieldname]=int(fields[fieldname])
> > ValueError: invalid literal for int() with base 10: '\xe5\xbc
> > \xb5\xe5\xbf\x97\xe9\x81\x93'
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to