I think i misunderstood then.
Em domingo, 29 de março de 2015 01:15:01 UTC-3, Anthony escreveu:
>
> Yes, but you are doing the opposite here. You are not checking whether a
> field value belongs to a list - you are checking whether a list stored in a
> field contains a particular value. The book
Yes, but you are doing the opposite here. You are not checking whether a field
value belongs to a list - you are checking whether a list stored in a field
contains a particular value. The book section on the list:-type fields
specifically says to use .contains for this purpose. This is not a job
Even on documentation has belongs checking if a value(or iterable obj) is
in the field:
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs
"
belongs
The SQL IN operator is realized via the belongs method which returns true
when the field value belongs to the
If you want to see if a particular item is in the stored list, the correct
method has always been .contains(), not .belongs(). Using the later doesn't
really make sense in this context (.belongs() is for checking whether a
single value stored in a database field is in a list of values -- we are
Which web2py version was working ? What was the sql output?
As you mentioned, replacing belongs with contains fixed the problem.
On Saturday, March 28, 2015 at 6:53:50 PM UTC+1, Leonardo Pires Felix wrote:
>
> Not working too on the version for testers, in this case using sqlite.
> Example:
>
>
Not working too on the version for testers, in this case using sqlite.
Example:
db.define_table("business_day",
Field("description", notnull=True),
Field("week_days", "list:integer", notnull=True))
db.business_day.insert(description='first week january 2015', week_d
Can you please try the "for testers" version on the web site? Can you
provide a simpler example to reproduce the problem?
On Saturday, 28 March 2015 10:43:56 UTC-5, Leonardo Pires Felix wrote:
>
> Hi,
> I think on last update the belongs stoped working.
> I've a table that is defined like this:
>
Looks like that the belongs function to the "list:" has changed to
the "contains", that's correct?
Em sábado, 28 de março de 2015 12:43:56 UTC-3, Leonardo Pires Felix
escreveu:
>
> Hi,
> I think on last update the belongs stoped working.
> I've a table that is defined like this:
> db.define_tabl
8 matches
Mail list logo