pallets-eco / flask-admin

Simple and extensible administrative interface framework for Flask
BSD 3-Clause "New" or "Revised" License
5.69k stars 1.56k forks source link

QueryAjaxModelLoader and additional filters #2414

Open pankus opened 4 months ago

pankus commented 4 months ago

I follow the instruction from the official documentation for form_ajax_refs

form_ajax_refs = {
    'active_user': QueryAjaxModelLoader('user', db.session, User, filters=["is_active=True", "id>1000"]) 
}

yet if I try to pass filters to the QueryAjaxModelLoader the following error message exits: sqlalchemy.exc.ArgumentError: Textual SQL expression 'is_active=True' should be explicitly declared as text('is_active=True')