> # So, I want to dynamically add this fields gravity_x, gravity_y, 
> magnetism_x, magnetism_y, to the table
>

You can create Field objects and place them inside a list and then call 
.define_tables unpacking it.

# fixed values
fields = [Field("grapes"), Field("pineapples")]

# build fieds from a list of values
[fields.append(Field(fruit)) for fruit in ["oranges", "apples", "bananas"]]

db.define_table(*fields)

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to