Here are the (modified) equivalent web.select and web.query
statements.

for row in web.select('tableA',
        what='fieldB',
        where='fieldB LIKE $q',
        limit=limit,
        vars={'q':q}):
        print row

for row in web.query("""
        SELECT fieldB FROM tableA
        WHERE fieldB LIKE $q
        LIMIT $limit)""",
        vars={'q':q, 'limit':limit}:
        print row

1. The web.select works but the web.query doesn't.  Can you see what
I'm missing in the web.query statement?

2. If the web.select is syntactic sugar is web.query the preferred way
to write SQL statements?



On Apr 13, 2:27 pm, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> >         vars={('q':q), ('limit':limit)}:
>
> I don't think this is valid syntax; I assume you mean;
>
>          vars={'q':q, 'limit':limit}:
>
> >  Are these statements equivalent?  If so, why choose one over the
> >  other?
>
> Yes, the first is purely syntactic sugar.
--~--~---------~--~----~------------~-------~--~----~
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