We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I am trying to query a subquery in Django, and in my Flask app I used to query like this:
db.session.query(some_subquery)
How can I access session instance or alternatively how can I do the same query from Model?
I have tried this:
some_subquery.sa.query() and some_subquery.query()
some_subquery.sa.query()
some_subquery.query()
Both throwing an exception of attribute/method does not exist.
Please help.
The text was updated successfully, but these errors were encountered:
After some googling I found this link. https://rodic.fr/blog/sqlalchemy-django/
I have implemented the session instance this way, but I am not sure it is the best way:
from sqlalchemy.orm import sessionmaker from aldjemy.core import get_engine
from sqlalchemy.orm import sessionmaker
from aldjemy.core import get_engine
def Session(): engine = get_engine() _Session = sessionmaker(bind=engine) return _Session()
def Session():
engine = get_engine()
_Session = sessionmaker(bind=engine)
return _Session()
session = Session()
session.query(some_subquery)
Sorry, something went wrong.
No branches or pull requests
Hi, I am trying to query a subquery in Django, and in my Flask app I used to query like this:
db.session.query(some_subquery)
How can I access session instance or alternatively how can I do the same query from Model?
I have tried this:
some_subquery.sa.query()
and
some_subquery.query()
Both throwing an exception of attribute/method does not exist.
Please help.
The text was updated successfully, but these errors were encountered: