This should work:
product_obj = products.all()[0]
db.session.expunge(product_obj) # expunge the object from session
make_transient(product_obj) # http://docs.sqlalchemy.org/en/rel_1_1/orm/session_api.html#sqlalchemy.orm.session.make_transient
product_obj.product_uid = 'something'
db.session.add(product_obj)
Related Contents:
- How to execute raw SQL in Flask-SQLAlchemy app
- How to update SQLAlchemy row entry?
- How to delete a record by id in Flask-SQLAlchemy
- Flask SQLAlchemy query, specify column names
- How do I know if I can disable SQLALCHEMY_TRACK_MODIFICATIONS?
- sqlalchemy.exc.NoSuchModuleError: Can’t load plugin: sqlalchemy.dialects:postgres
- SQLAlchemy ORM conversion to pandas DataFrame
- jsonify a SQLAlchemy result set in Flask [duplicate]
- Case Insensitive Flask-SQLAlchemy Query
- Flask-SQLAlchemy how to delete all rows in a single table
- flask-sqlalchemy or sqlalchemy
- SQLAlchemy create_all() does not create tables
- Flask sqlalchemy many-to-many insert data
- What is the difference between the declarative_base() and db.Model?
- Flask-SQLalchemy update a row’s information
- Getting first row from sqlalchemy
- How to build a flask application around an already existing database?
- ImportError: No module named sqlalchemy
- Could not assemble any primary key columns for mapped table
- unable to create autoincrementing primary key with flask-sqlalchemy
- Flask-SQLAlchemy check if row exists in table
- AttributeError: ‘int’ object has no attribute ‘_sa_instance_state’
- Flask SQLAlchemy querying a column with “not equals”
- Inserting new records with one-to-many relationship in sqlalchemy
- scoped_session(sessionmaker()) or plain sessionmaker() in sqlalchemy?
- Pylint can’t find SQLAlchemy query member
- SQLAlchemy – performing a bulk upsert (if exists, update, else insert) in postgresql
- SQLAlchemy ManyToMany secondary table with additional fields
- Updates to JSON field don’t persist to DB
- What is the difference between .one() and .first()
- Separate SQLAlchemy models by file in Flask [duplicate]
- sqlalchemy : executing raw sql with parameter bindings
- sqlalchemy foreign key relationship attributes
- How to use avg and sum in SQLAlchemy query
- SQLAlchemy delete doesn’t cascade
- SQLAlchemy: Hybrid expression with relationship
- Defining SQLAlchemy enum column with Python enum raises “ValueError: not a valid enum”
- Using OR in SQLAlchemy
- sqlalchemy IS NOT NULL select
- How do I get a raw, compiled SQL query from a SQLAlchemy expression?
- SQLAlchemy versioning cares about class import order
- Switching from SQLite to MySQL with Flask SQLAlchemy
- Alembic: IntegrityError: “column contains null values” when adding non-nullable column
- Writing to MySQL database with pandas using SQLAlchemy, to_sql
- Bulk insert a Pandas DataFrame using SQLAlchemy
- How do I catch a psycopg2.errors.UniqueViolation error in a Python (Flask) app?
- Doing DateTime Comparisons in Filter SQLAlchemy
- How to use Flask-SQLAlchemy in a Celery task
- SQLAlchemy: a better way for update with declarative?
- Can I avoid circular imports in Flask and SQLAlchemy