To optimize a query I wanted to create a constant that represented the list of fields to select(). I ended up doing a join like I saw in the web2py source for SQLALL. Is this the best way? I tried a bunch of different other ways but none worked.
item_summary_fields = ', '.join([str(field) for field in [db.item.id, db.item.title, db.item.image_thumb, db.item.currency, db.item.shipping_method, db.item.start_price, db.item.drops, db.item.duration, db.item.price_change, db.item.created_on]]) rows = db(db.item.id>0).select(item_summary_fields)