please try (not tested):
query = (db.kamernet.province == 'Limburg') & (db.kamernet.province == 
'North Brabant')

best regards,
stifan

On Friday, May 2, 2014 5:45:15 PM UTC+7, Ruud Schroen wrote:
>
> Hi,
>
> I'm trying to use the pagination from web2py_utils with two queries. 
> Usually the code looks like this:
>
> query = db.table.id > 0
> count = db(query).count()
> results = db(query).select(orderby=~db.table.created_on)
> orderby = ~db.table.id
> pcache = (cache.ram, 15)
> paginate = web2py_utils.paginate.Pagination(db, query, orderby, 
> display_count=10, cache=pcache, r=request, res=response)
> results=paginate.get_set(set_links=True)
>
> But i need to use this query:
>
> query = db.kamernet.province == 'Limburg' and db.kamernet.province == 
> 'North Brabant'
>
> I get no error, however, when i use the OR operator, it only returns 
> records with the province "Limburg", when i use the AND operator it only 
> returns records with "North Brabant".
>
> I could use a select() query but then i get this error:
>
> OperationalError: near ",": syntax error
>
>
> Anyone know how i can fix this?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to