aren't you missing the db. before table? like
def something(): grilla = SQLFORM.smartgrid(db.table_1) and then for the orderby statement should be: def something(): grilla = SQLFORM.smartgrid(db.table_1, orderby=db.table_1.field) that should work. > Hello > > Suppose we have the following: > > #Model: > table_1 = db.define_table('table1', > Field('name'), > ) > > > > table_2 = db.define_table('table2', > Field('field1'), > Field('field2', table_1), > ) > > > #Controller: > > def something(): > grilla = SQLFORM.smartgrid(table_1) > > > > this shows me the grid with records from table1 and a link to another > grid with table2 records. This is correct. > > But if I do the following: > > def something(): > grilla = SQLFORM.smartgrid(table_1, orderby= table_1) > > > The first grid shows good and well ordered, but when trying to > display records from table2 through the link, can't get the records > because it is sort of a field belonging to table1 > > *Query Not Supported: no such column: table1.name* > * > * > > Jose > --