Hi,

I've made 2 improvement to the db module.

1. The where clauses can be a dict now.

This makes it easier to write where clause without having to do $
substitutions in the queries. It joins all the key-value pairs in the dict
with AND.

For example:

>>> db.select("post", where={"category": "popular", "published": True},
limit=5, _test=True)
<sql: "SELECT * FROM post WHERE category = 'popular' AND published = 't'
LIMIT 5">

2. Added first() method to IterBetter

Now it is much easier to get the first row of query result.

p = db.select("person", where={"email": "[email protected]"}).first()

The code is checked in to the master branch as usual.

https://github.com/webpy/webpy

Please let me know your comments.

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to