I have a Flask route(method) that assigns queries to 4 connect objects. 3
work fine, 1 was working, but now gives me a sqlalchemy.exc.ResourceClosedError
and I can't get it working again. When I paste that same sql into a
dbmanager it returns 5 records as expected.
What else could be causing this?
Here is the offending line:
progress = con.execute("select goals.category, sum(transactions.amount) as
sum, goals.goal, ((sum(transactions.amount)/ goals.goal )*100) as progress
from goals, transactions where goals.category=transactions.category and
goals.email=:param group by goals.category", {"param":session['email']} )
return render_template('home.html', progress=progress )
end of stack trace:
- File "E:\Dropbox\flask\lib\site-packages\sqlalchemy\engine\base.py",
line *3051*, in __iter__
row = self.fetchone()
- File "E:\Dropbox\flask\lib\site-packages\sqlalchemy\engine\base.py",
line *3241*, in fetchone
row = self._fetchone_impl()
- File "E:\Dropbox\flask\lib\site-packages\sqlalchemy\engine\base.py",
line *3158*, in _fetchone_impl
self._non_result()
- File "E:\Dropbox\flask\lib\site-packages\sqlalchemy\engine\base.py",
line *3182*, in _non_result
raise exc.ResourceClosedError("This result object is closed.")
ResourceClosedError: This result object is closed.
This seems to imply there was a fetchone issue.. It should be producing an
iterable set that my template for loop can work through.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.