The error occurs not as an exception, but inside html.
model:
db.define_table('config',
Field('config_name', length=50, required=True, unique=True),
Field('convert_option', length=50,
requires=IS_IN_SET(CONVERSION, zero=None)),
Field('config_value', length=50, required=True),
Field('default_value', length=50, required=True),
auth.signature,
Field.Virtual('conv_config_value',
lambda row:
eval(row.config.convert_option)(row.config.config_value)),
Field.Virtual('conv_default_value',
lambda row:
eval(row.config.convert_option)(row.config.default_value)),
format='%(config_name)s : %(convert_option)s(%(config_value)s) -
%(id)s')
controller
def index():
form = SQLFORM.grid(db.config) <-- returns no data and the message:
Query Not Supported: no such column: config.conv_config_value
return locals()
def index():
fields = (config_name, )
form = SQLFORM.grid(db.config, fields=fields) <-- returns all data, and
no error message
return locals()
The question is:
do i have to specify explicitly what fields to display if i have virtual
field in my db definition?
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.