Yes, that's what I want. I'll give it a try , thanks. On Saturday, February 1, 2014 10:30:28 PM UTC+2, Anthony wrote: > > Without the ability to post data to reference fields it's a problem to >> achieve it. just posting the reference data as strings won't allow me to >> make these filters, unless I will insert them into tables after posting to >> the tests results table. (I think). >> > > Keep in mind, a reference field references an entire record in another > table, not just a particular string field in that table. In general, the > referenced table may not even include a string field that contains unique > values, so you couldn't reference a particular record simply by specifying > a single string. > > I'm not sure I completely follow your data model, but for example, is the > f_platform field a reference to the db.t_types table (which itself contains > an f_platform_name field)? Is it the case that you want users to be able to > specify an f_platform_name string and have that converted to the > appropriate record ID of the t_types table so the ID can be stored in the > f_platform field? If so, you just need to write the code to do that: > > post_params['f_platform'] = db(db.t_types.f_platform_name == > post_params['f_platform']).select(db. > t_types.id).first().id > > That will use the string value of f_platform to look up the record ID in > db.t_types, and then change post_params['f_platform'] to that record ID. > You could do something similar for any other fields that need to be looked > up/converted. > > Anthony > >
-- 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/groups/opt_out.