[ANNOUNCE] KirbyBase 1.0

Ian Bicking ianb at colorstudy.com
Wed Apr 9 02:21:41 EDT 2003


On Tue, 2003-04-08 at 23:21, Jamey Cribbs wrote:
> 4. KirbyBase allows you to specify field types, then it  allows you to 
> use Python's regular expression syntax to search by string fields and 
> Python expressions to search by numeric fields.  So, for exampe, to 
> search a table containing info on WWII fighter planes and select US 
> planes that had a maximun speed higher than 400 mph, you would say 
> something like:
> 
>      db.select('plane.tbl', ['country', 'speed'], ['USA', '>400'])
> 
> I like doing this more than building SQL query strings in Python.

You might be interested in the query builder I'm using in SQLObject
(sqlobject.org), in the SQLObject.SQLBuilder module.  It allows you to
write a query like:

  (column.country == "USA") & (column.speed > 400)

Or:

  country_code = "USA"
  required_speed = 400
  (column.country == country_code) & (column.speed > required_speed)

-- 
Ian Bicking  ianb at colorstudy.com  http://colorstudy.com
4869 N. Talman Ave., Chicago, IL 60625  /  773-275-7241
"There is no flag large enough to cover the shame of 
 killing innocent people" -- Howard Zinn






More information about the Python-list mailing list