fix grid groupby with more than 2 Fields in the expression
This commit is contained in:
@@ -2111,6 +2111,8 @@ class SQLFORM(FORM):
|
|||||||
field_id = groupby #take the field passed as groupby
|
field_id = groupby #take the field passed as groupby
|
||||||
elif groupby and isinstance(groupby, Expression):
|
elif groupby and isinstance(groupby, Expression):
|
||||||
field_id = groupby.first #take the first groupby field
|
field_id = groupby.first #take the first groupby field
|
||||||
|
while not(isinstance(field_id, Field)): # Navigate to the first Field of the expression
|
||||||
|
field_id = field_id.first
|
||||||
table = field_id.table
|
table = field_id.table
|
||||||
tablename = table._tablename
|
tablename = table._tablename
|
||||||
if not any(str(f) == str(field_id) for f in fields):
|
if not any(str(f) == str(field_id) for f in fields):
|
||||||
|
|||||||
Reference in New Issue
Block a user