Hi all
I’m having problems trying to tailor the grid to my needs
I've set up a grid to query my db and it retrieves the data successfully, great!
Example: def gridquery():
grid = SQLFORM.grid((db.MAIN.TaxonID == db.TAXON.TaxonID), field_id = db.MAIN.MainID, fields=[db.TAXON.TaxonName, db.TAXON.CommonName, db.TAXON.TaxonomicPhylum])
return locals()
However, the search box contains all of the columns in all of the connected tables. I want to limit the searches only to the fields i have specified e.g. 'fields=[db.TAXON.TaxonName, db.TAXON.CommonName, db.TAXON.TaxonomicPhylum])'.
1. I've tried to do a few things i.e. setting the unwanted search fields to 'writable = False & readable = False'
2. also tried this method [setattr(f, 'readable', False) for f in mydb if f.name not in ('mydb.field')]
However, this limits the query results - i want to include all the tables fields in the query results, just not in the searches.
Does anyone have any suggestions? As I understand I might need to build a custom widget, at my current level this seems rather complicated,is there a simpler work around?.
Thanks!