Fix auto-creation of grid sorter, when joined table is involved.
This commit is contained in:
parent
bcb5176718
commit
747471b08a
|
@ -126,7 +126,8 @@ class AlchemyGrid(Grid):
|
||||||
Returns a function suitable for a sort map callable, with typical logic
|
Returns a function suitable for a sort map callable, with typical logic
|
||||||
built in for sorting applied to ``field``.
|
built in for sorting applied to ``field``.
|
||||||
"""
|
"""
|
||||||
column = getattr(self.model_class, model_property.key)
|
class_ = getattr(model_property, 'class_', self.model_class)
|
||||||
|
column = getattr(class_, model_property.key)
|
||||||
return lambda q, d: q.order_by(getattr(column, d)())
|
return lambda q, d: q.order_by(getattr(column, d)())
|
||||||
|
|
||||||
def load_settings(self):
|
def load_settings(self):
|
||||||
|
|
Loading…
Reference in a new issue