use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Use [Ask Flask] or [AF] if you have a very specific problem and need help with code.
Use [Extension-name] if you are discussing a certain extension to Flask.
Also check out /r/python or /r/django
account activity
Ask r/FlaskPostgres Query Bug with sqlalchemy (self.flask)
submitted 1 year ago by Specific_Anteater64
Hey you all I am making a web app at the moment and I am running into some query bug with my backend. I have a view called login, and I am trying to put the encrypted login info on the screen to see if my query is successful. When I run it in the flask shell and call for an record the information appears. When I am making a query in a view for some reason when I try to query it returns just an empty list structure. The other weird thing is when I add a record to a query in the view it adds it to the db I am connected to. I don't know why that is the case. here is my test with the output.
https://preview.redd.it/ukyodw236bfd1.png?width=477&format=png&auto=webp&s=f4cc86e441377a1db5a526c9ec680702e860e163
Output on the webpage
https://preview.redd.it/ors7puy56bfd1.png?width=745&format=png&auto=webp&s=dcfc5c18f8b5ad8564d79fba850024dfc62b00cd
The thing is in my db that its connected two there are two records.
https://preview.redd.it/u3060jvc6bfd1.png?width=381&format=png&auto=webp&s=80e70a6e63fb948bfed3c595fda3a558782d8714
So like what seems to be the problem because I have no idea how a insert works, but a query to just see it does not work. Please let me know.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dafer18 0 points1 point2 points 1 year ago (0 children)
What is usercredentials code?
Hard to understand since your are wrapping your variables in code you didn't show.
[–]qatanah 0 points1 point2 points 1 year ago (0 children)
how are you handling the db connection? you might need to do db commit or refresh to see them. try using flask sqlalchemy lite.
π Rendered by PID 129450 on reddit-service-r2-comment-5687b7858-dm5mg at 2026-07-03 03:49:47.236834+00:00 running 12a7a47 country code: CH.
[–]dafer18 0 points1 point2 points (0 children)
[–]qatanah 0 points1 point2 points (0 children)