I've been seeing this in various places around turbogears and example code, and I thought I'd just make a comment about it:

"except SQLObjectNotFound:"

Using sqlobject.SQLObjectNotFound isn't actually necessery. SQLObjectNotFound extends LookupError, which is a builtin, so you can just use

try:
   o = foo.byName(bar)
except LookupError:
   raise cherrpy.HTTPRedirect, '/'

should work. :)
--
Regards,
Stephen Thorne
Development Engineer

Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)

Reply via email to