[Python] How can I update SQLAlchemy ORM object by a Python dict?

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    The dict's key names are mapping to the SQLAlchemy object attributes:

    class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True)
    name = Column(String)
    fullname = Column(String)
    password = Column(String)


    can update from id = 3, {name: "diana"} or id = 15, {name: "marchel", fullname: "richie marchel"}

    Continue reading...

Compartilhe esta Página