On Nov 12, 2015, at 7:33 AM, Wang Yan <snailcoder@163.com> wrote:

Absolutely that's what I'm looking for! Thanks a lot!

Glad I could help!

However, I'm wondering if Twisted and Klein support filtering results. For example, the User table in MySQL contains id, name and age fields. How can I get all users whose name are "Alan" and age > 16? It seems I need a filter, but I'm not sure how to implement such a filter or resource with Twisted and Klein.

Klein is pretty purely a web-facing framework; it just helps you built the HTTP stuff that answers queries.  It doesn't help you talk to a database at all; you have to figure out your own way to do that.  This is historically a weak area for Twisted, sadly; you might find https://pypi.python.org/pypi/twextpy/ useful as this brings the state of the art forward somewhat.

https://twistedmatrix.com/trac/ticket/7917 is a ticket to bring that stuff into Twisted itself; if you are interested in Twisted/Database interaction, perhaps you could help split up the code there into smaller branches that can be merged.

Thanks!

-glyph