Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryAjaxModelLoader and additional filters #2414

Open
pankus opened this issue Feb 26, 2024 · 1 comment
Open

QueryAjaxModelLoader and additional filters #2414

pankus opened this issue Feb 26, 2024 · 1 comment

Comments

@pankus
Copy link

pankus commented Feb 26, 2024

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')

@samuelhwilliams
Copy link
Contributor

If you do what the error recommends, does the problem go away? Is this a documentation issue (presumably with newer versions of SQLAlchemy), or a bug in flask-admin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants