I changed the code to the following:

*was:*
*db3.define_table('station_analysis_parameters',*
* ...*
*    Field('station_preset_file', 'reference analysis_presets', 
requires=IS_IN_DB(db3, 'analysis_presets.filename')),*
*...*

*now:*
*db3.define_table('station_analysis_parameters',*
* ...*
*    Field('station_preset_file', 'reference analysis_presets', 
requires=IS_IN_DB(db3, 'analysis_presets.id', '%(filename)s')),*
*...*

Now the id of the row of the reference field appears in the grid display. 
This is useless for display purposes. Can I override this and display the 
actual value of the referenced filed in my grid?? While we are at it I 
changed the field to type='upload' to see if that would work...This gave a 
similar problem a cryptic 'file' link to download the file appears instead 
of the filename. When I edit a row the edit form says that the filename 
field is not set. Can I change this to show the filename?


*...*


On Tuesday, June 23, 2015 at 11:43:03 AM UTC-4, [email protected] 
wrote:
>
> When I display a grid of the table 'station_analysis_parameters' and edit 
> either 'common_params_preset_file' or 'reference analysis_presets'  a 
> dropdown list with the rows from analysis_presets.filename' appears 
> but choosing and entry from this list  and clicking submit does not do save 
> anything the two reference fields remain 0? All the other fields in the 
> table work.  Anybody see what I am doing wrong?
>
> db3 = DAL('sqlite://autoflowForms.sqlite')
> db3.define_table('analysis_presets',
>     Field('filename'))
> db3.define_table('sample_ids',
>     Field('sample_id'))
> db3.define_table('station_analysis_parameters',
>     Field('common_params_preset_file', 'reference analysis_presets', 
> requires=IS_IN_DB(db3, 'analysis_presets.filename')),
>     Field('operator', requires=[IS_NOT_EMPTY(), IS_ALPHANUMERIC()]),
>     Field('gasport', requires=IS_IN_SET(['1', '2', '3'])),
>     Field('enable', type='boolean'),
>     Field('station_preset_file', 'reference analysis_presets', 
> requires=IS_IN_DB(db3, 'analysis_presets.filename')),
>     Field('weight', type='double',requires=[IS_NOT_EMPTY(), 
> IS_FLOAT_IN_RANGE(1e-2, 1e2)]),
>     Field('sample_id',requires=[IS_NOT_EMPTY(), IS_ALPHANUMERIC()]),
>     Field('description', type='text'))
>

-- 
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/d/optout.

Reply via email to