Commit bd1a80b8 authored by Tom Kedem's avatar Tom Kedem

updated hybrid property detection to new sqlalchemy api.

parent 4348d60b
......@@ -2,9 +2,10 @@ import logging
import warnings
import inspect
from sqlalchemy.ext.hybrid import HYBRID_PROPERTY
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm import joinedload, aliased
from sqlalchemy.sql.expression import desc, ColumnElement
from sqlalchemy.sql.expression import desc
from sqlalchemy import Boolean, Table, func, or_
from sqlalchemy.exc import IntegrityError
from sqlalchemy.sql.expression import cast
......@@ -603,7 +604,7 @@ class ModelView(BaseModelView):
return filters
else:
is_hybrid_property = isinstance(attr, ColumnElement)
is_hybrid_property = hasattr(attr, 'descriptor') and attr.descriptor.extension_type == HYBRID_PROPERTY
if is_hybrid_property:
column = attr
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment