Also, you would get exceptions if table does not exists, so:
def feed(table):
*try*:
return db(db[table].id>0).select()
*except* KeyError:
return "Sorry, table not found"
*Bruno Cezar Rocha** - @rochacbruno*
[email protected] | Mobile: +55 (11) 99210-8821
www.CursoDePython.com.br | www.rochacbruno.com.br
Blog: I am now a member of Python Software
Foundation<http://rochacbruno.com.br/i-am-now-a-member-of-python-software-foundation/>
Get a signature like this.
<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
Click
here.<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
On Fri, Aug 17, 2012 at 6:41 PM, apps in tables <[email protected]>wrote:
>
>
> Thank you, Anthony.
>
>
> On Friday, August 17, 2012 10:37:02 PM UTC+3, Anthony wrote:
>>
>> db.mytable.fields is a list of the field names, and db.mytable.fields()
>> returns a copy of that list (so if you mutate the copy, the original list
>> doesn't change).
>>
>> Anthony
>>
>> On Friday, August 17, 2012 2:27:22 PM UTC-4, apps in tables wrote:
>>>
>>>
>>> How to get the list of the fields names?
>>>
>>> On Friday, August 17, 2012 6:37:58 PM UTC+3, rochacbruno wrote:
>>>>
>>>>
>>>> def feed(table):
>>>>> return db(db[table].id>0).select()
>>>>
>>>>
>>>> --
>
>
>
>
--