SOLVED !!
The table I try to select()  has a common filter property and this requires 
an extra parameter that I do not supply in my dummy function.
The very simple solution is to add ignore_common_filters=True to the query
Sorry for the disruption



On Saturday, May 27, 2017 at 9:23:04 PM UTC+2, icodk wrote:
>
> I have a simple function in a controller that I try to execute from 
> command line but gets a strange error:
> I start the shell with this command:
> web2py -S myapp/test/ -M
>
> I then call the function with the following command:
> >>>dummy_task()
>
>
> Dummy_taks () is defined as:
>  def dummy_task():
>     rows=db(db.shop_product).select()
>     print rows
>
>
> ... and I get the following error:
> >>> dummy_task()
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "applications\myapp\controllers\test.py", line 4, in dummy_task
>     rows=db(db.shop_product).select()
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\objects.py", 
> line 2020, in select
>     return adapter.select(self.query, fields, attributes)
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 1283, in select
>     sql = self._select(query, fields, attributes)
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 1170, in _select
>     sql_w = ' WHERE ' + self.expand(query) if query else ''
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 954, in expand
>     rv = op(first, **optional_args)
> TypeError: AND() takes exactly 3 arguments (2 given)
> >>>
>
> Whats  wrong  here ?
> Thanks in advance
>
>

-- 
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