bug ticket for IS_IN_DB validator

21 views
Skip to first unread message

Manuele Pesenti

unread,
Feb 4, 2012, 8:25:00 AM2/4/12
to web...@googlegroups.com
I opened this ticket

http://code.google.com/p/web2py/issues/detail?id=647&q=is_in_db

does anobody else found similar problems in using IS_IN_DB validator
with option multiple=True

that is the default for 'list:reference' type fields?

cheers

Manuele

DenesL

unread,
Feb 4, 2012, 9:16:29 PM2/4/12
to web2py-users
In the issue report you say:

What steps will reproduce the problem?
1. create a table (for example: db.define.table('mytab',
Field('foo')))
...
IS_IN_DB(db, 'mytab.id', '%(foo)s', multiple=True)(value)

but IS_IN_DB(..., multiple=True) should be used for field type
list:reference as discussed in Chapter 6 of the book, but mytab.id
type is reference, not list:reference.

Manuele Pesenti

unread,
Feb 5, 2012, 8:54:19 AM2/5/12
to web...@googlegroups.com
Il 05/02/2012 03:16, DenesL ha scritto:
> In the issue report you say:
>
> What steps will reproduce the problem?
> 1. create a table (for example: db.define.table('mytab',
> Field('foo')))
> ...
> IS_IN_DB(db, 'mytab.id', '%(foo)s', multiple=True)(value)
>
> but IS_IN_DB(..., multiple=True) should be used for field type
> list:reference as discussed in Chapter 6 of the book, but mytab.id
> type is reference, not list:reference.
Hi Danes,

Yes you're right but It's not necessary to define another table with a
list:reference field to test the validator while I can directly call the
validator. Anyway I got the problem using the method
"validate_and_update" for a field of type "list:reference" but the same
list passed to the simple "update" method worked fine.
In my example I immagine to use a list:reference field without an
explicit definition... I don't think it's a problem. I thought to better
focus on the problem with this example, but maybe I wouldn't be so clear.

well I can say a little more... actually I have used in my project the
definition of a "list:reference" field and everything works fine through
the web interface where I can insert, upgrade, delete and so on even
after the code modification I proposed in the issue.

Thanks for your attention

Cheers

Manuele

Reply all
Reply to author
Forward
0 new messages