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

AttributeError: 'Query' object has no attribute '_join_entities' #6

Open
MinuraPunchihewa opened this issue Mar 21, 2023 · 1 comment

Comments

@MinuraPunchihewa
Copy link

MinuraPunchihewa commented Mar 21, 2023

Hi @cs91chris,
First of all, thank you for this awesome project!

I am getting the above error, when I try to run a request against any of the model endpoints,

import os
import pyodbc
from dotenv import load_dotenv

from flask import Flask

from flask_autocrud import AutoCrud, Model
from flask_sqlalchemy import SQLAlchemy

load_dotenv()


app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = f"{os.environ.get('DB_CONN_STR')}?driver={pyodbc.drivers()[-1]}"
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['AUTOCRUD_METADATA_ENABLED'] = True
app.config['AUTOCRUD_DATABASE_SCHEMA'] = os.environ.get('DB_TABLE_SCHEMA')

db = SQLAlchemy(app)

with app.app_context():
    AutoCrud(app, db)

if __name__ == '__main__':
    app.run(debug=True)

When I run a requests against the /resources endpoint I see all of the tables in my schema though.

Am I doing something wrong here?

Note: My SQLAlchemy version is 2.0.6.

@cs91chris
Copy link
Owner

Hi @MinuraPunchihewa, thanks and sorry for the late response. This repo is old and not maintened too, but I am sure that it is not compatible with sqlalchemy 2 for the breaking changes that ships with it.

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

No branches or pull requests

2 participants