Skip to content

Add validation to filter_and_sort Β #2

@NicolasJott

Description

@NicolasJott

If column defined by sort_by does not exist on the model being queried, we need to handle this in an elegant fashion.

Currently, this is what happens in this case:

line 8, in filter_and_sort
    column = getattr(stmt.column_descriptions[0]["entity"], query_model.sort_by)
AttributeError: type object 'Store' has no attribute 'address'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions