http://www.wellho.net/mouth/912_Recursion-in-Python.html
<http://www.wellho.net/mouth/912_Recursion-in-Python.html>perhaps this could be a better solution (not tested, I just give you an idea) class MyVirtualFields(object): def item_countself): sum = db.order_item.quantity.sum() return db(db.order_item.item==self.item).select(sum).first()[sum]

