Hello!

Why does sqlors function 
(https://github.com/webpy/webpy/blob/master/web/db.py#L351) return "1=2" at 
the end of the OR'ed list?

>From the source's example:

    >>> sqlors('foo = ', [1,2,3])
    <sql: '(foo = 1 OR foo = 2 OR foo = 3 OR 1=2)'>

And in the code:

    return SQLQuery(['('] + 
        sum([[left, sqlparam(x), ' OR '] for x in lst], []) +
        ['1=2)']
    )

Why not instead make the list without the last OR?

    ['('] + sum([[left, sqlparam(x), ' OR '] for x in lst], [])[:-1] + [')']

Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/webpy/-/QU1Cg3XINI0J.
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