diff --git a/sqlalchemy_filters/models.py b/sqlalchemy_filters/models.py index 1c79516..2f33387 100644 --- a/sqlalchemy_filters/models.py +++ b/sqlalchemy_filters/models.py @@ -76,7 +76,7 @@ def get_query_models(query): if model_class not in models: models.append(model_class) - return {model.__name__: model for model in models} + return {model.__name__: model for model in models if model is not None} def get_model_from_spec(spec, query, default_model=None):