Python Forum
flask-SQLAlchemy query with keyword as function argument
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
flask-SQLAlchemy query with keyword as function argument
#2
Hi all.
I am sorry but I asked this question on another forum yesterday (a cardinal sin) and somebody has helped me. Its the first time anybody has helped me on that forum. any way the answer to my problem is:
    
    rows = Pins.query.filter_by(pin=changePin).all()
    deviceName = rows[0].name
It works but I dont understand how the "rows[0].name" works for all rows (ie if I call pin 23 name for 23 is displayed) Is "rows[0].name" a dictionary produced by
rows = Pins.query.filter_by(pin=changePin).all()
There is so much to learn!!
I love python
Reply


Messages In This Thread
RE: flask-SQLAlchemy query with keyword as function argument - by pascale - Mar-03-2019, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked pythonpaul32 1 2,207 Apr-04-2023, 07:44 AM
Last Post: Larz60+
  Flask error sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint pythonpaul32 2 3,872 Feb-21-2023, 03:13 AM
Last Post: noisefloor
  Flask and SQLAlchemy question: Database is being created but tables aren't adding pythonpaul32 3 4,977 Feb-07-2023, 10:48 AM
Last Post: pythonpaul32
  Flask run function in background and auto refresh page raossabe 2 7,888 Aug-20-2022, 10:00 PM
Last Post: snippsat
Shocked Django __init__() got an unexpected keyword argument 'any' ikurorox 2 5,646 Nov-26-2021, 07:57 PM
Last Post: ikurorox
  IndexError: list index out of range" & "TypeError: The view function f: Flask Web App joelbeater992 5 3,614 Aug-31-2021, 08:08 PM
Last Post: joelbeater992
  Error updating one to many relationship in Flask/ SQLAlchemy atindra 0 3,390 Apr-15-2021, 10:29 PM
Last Post: atindra
  Flask migrate sqlalchemy not found TomasAm 2 3,553 Dec-01-2020, 10:04 AM
Last Post: TomasAm
  how to pass javascript variables to url_for function in a flask template experimental 5 6,505 Oct-29-2020, 03:29 AM
Last Post: universe
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 4,049 Aug-12-2020, 07:24 PM
Last Post: Alpy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020