1
0
Fork 0

fix: avoid error when checking model for column property

assocation proxy sometimes throws a wrench in that..
This commit is contained in:
Lance Edgar 2024-08-19 12:42:14 -05:00
parent dce91a3a96
commit 784f974c0d

View file

@ -578,7 +578,8 @@ class Grid:
if key in sorters:
continue
prop = getattr(self.model_class, key, None)
if prop and isinstance(prop.property, orm.ColumnProperty):
if (prop and hasattr(prop, 'property')
and isinstance(prop.property, orm.ColumnProperty)):
sorters[prop.key] = self.make_sorter(prop)
return sorters