have you tried  eval  ??

fields = [eval ('db.mytable.field1') , eval ('db.mytable.field2') ] 



(just a suggestion. I didn't tried myself)

On Friday, March 27, 2015 at 2:24:06 PM UTC-5, LoveWeb2py wrote:
>
> having trouble with the SQLFORM.smartgrid fields section
>
> Fields only takes 
>
> fields = [db.mytable.field1, db.mytable.field2]
>
> I have a function that returns all the fields to be returned, but they're 
> in strings format.
>
> fields = ['db.mytable.field1', 'db.mytable.field2'] #this returns an error 
> with SQLFORM
>
> How can I convert the strings to variables like in the first fields 
> example.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to