Posts Tagged with SQL Alchemy

17 Sep 2015, 21:15

Dynamically constructing filters based on string input using SQLAlchemy
Here I am going to write a dynamic filter. This filter is made for python 3. It will take query or model class and filter condition as input, It will return filtered query based on those filter condition. This is constructed using this SO answer. Function class DynamicFilter(ModelHelper): def __init__(self, query=None, model_class=None, filter_condition=None): super().