Okay, I tried with:

[L47]  for row in web.select('table.A', what='field.A', where="field.A
LIKE $q", limit=limit, vars={'q':q})
[L48]          print row

And, got this error:

Traceback (most recent call last):
  File "c:\python25\lib\site-packages\web\webapi.py", line 304, in
wsgifunc
    result = func()
  File "c:\python25\lib\site-packages\web\request.py", line 129, in
<lambda>
    func = lambda: handle(getattr(mod, name), mod)
  File "c:\python25\lib\site-packages\web\request.py", line 61, in
handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "C:\...\actdb.py", line 47, in GET
    for row in web.select('table.A', what='field.A', where="field.A
LIKE $q
", limit=limit, vars={'q':q}):
  File "c:\python25\lib\site-packages\web\db.py", line 584, in select
    return query(qout, processed=True)
  File "c:\python25\lib\site-packages\web\db.py", line 436, in query
    db_cursor = web.ctx.db_cursor()
  File "c:\python25\lib\site-packages\web\utils.py", line 703, in
__getattr__
    return getattr(self.__d[threading.currentThread()], attr)
  File "c:\python25\lib\site-packages\web\utils.py", line 54, in
__getattr__
    raise AttributeError, k
AttributeError: 'db_cursor'

localhost - - [13/Apr/2008 02:04:54] "GET /act?q=dog&limit=25 HTTP/
1.1" 200 -


The database connection statement is placed before web.run and is:

[L61]  web.connect(dbn='sqlite', db="testDB.db")

I don't have any other db.py statements.  Thanks!


On Apr 12, 4:41 pm, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> >  > "SELECT field.A FROM table.A WHERE field.A LIKE '%s' LIMIT '%s'" %(q, 
> > limit)
>
> web.select('table', what='field', where="field LIKE $q", limit=limit,
> vars={'q':q})
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to