Tom Tanner writes:
> Thanks, I used the first method. Follow up question: How do I get the new
> primary key after running `session.commit()`?
After a commit SA should have (re)populated the "id" field (or whatever it's
PK field is named) of the cloned object.
Thanks, I used the first method. Follow up question: How do I get the new
primary key after running `session.commit()`?
On Tuesday, December 19, 2017 at 11:29:34 AM UTC-5, Mike Bayer wrote:
>
> On Tue, Dec 19, 2017 at 3:02 AM, Tom Tanner
> wrote:
> > I'm using
On Tue, Dec 19, 2017 at 3:02 AM, Tom Tanner
wrote:
> I'm using SQLAlchemy with the Python library Flask.
>
> How do I query an object from a database, make a copy of it, and save that
> copy to the database?
>
> Example of querying an object.
> someObj =
I'm using SQLAlchemy with the Python library Flask.
How do I query an object from a database, make a copy of it, and save that
copy to the database?
Example of querying an object.
someObj = db.session.query(SomeDataTable).filter_by(id=someID).first()
I want to save a copy of `someObj` to the