I have a person table and a task table, every task references some person.
Both tables have a virtual field 'display_name' that constructs a meaningful coded name returned as a string to display on screen if person is a 'client'. SQLFORM.grid is used to provide a selectable list of entries filtered from the task table. *I want to use the coded display_names in the grid and to be able to search within the field content (as text) for filtering*. Using task.display_name (virtual field) in the grid creates issues because... the field it is not available to add to any search criteria. (note: It's not made readable=False anywhere) it's not sortable, it looks different - the title header is shown in plain black so not being handled in the same way as 'normal' fields . <https://lh3.googleusercontent.com/-su_lrPzxYAM/WS8EqtWx0aI/AAAAAAAAAJc/Q8gW93Y6DOY3n5LQ0AsOep68Jyh5rn89wCLcB/s1600/grid%2Busing%2Bdisplay_name.png> Trying a work around with task.person.... db.task.person.represent = lambda id, row: row.display_name results in other issues - the person field is available to search <https://lh3.googleusercontent.com/-wzbBSKy1Quc/WS8FUyKTHNI/AAAAAAAAAJk/FkWDnE_CK60Kx9uvMGOElhV3ryWlxh5LACLcB/s1600/grid%2Busing%2Bperson%2Breference.png> but when trying to add any search criteria (a name) it shows the default table 'format=' (i.e. not the coded names) in the drop down, sorting works but is done on hidden id and not by visible name/alphabetically. the list of available names to choose from is a complete list of all names in the person table i.e. not filtered to the available names in the grid entries also the choice is selectable as an id (= or !=) as opposed to searchable as text. So after all that (sorry if it's long winded)... Is it possible to get the display_name (virtual field) to appear/behave as a 'normal' field in the grid? Ideally making it available as an option in the field drop down list and available to search as text with appropriate selectors ('starts with', 'contains' etc and not as an id field like the person field with an extended drop down list of names). Thanks! -- 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.