You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expectation: Once we perform the commit, the object properties are available. I've confirmed this by printing/logging the id of the person using person.id, and it outputs the correct value. to_dict() outputs null instead of the correct value. It doesn't seem to have the committed object.
Interestingly enough if I uncomment the logger.info line, or if I add db.session.refresh(), the to_dict() outputs the correct result.
This is the result when I execute it with the line # logger.info(f"id: ",person.id) uncommented.
The text was updated successfully, but these errors were encountered:
nicolae-stroncea
changed the title
SQLAlchemy object not up to date when calling .to_dict().to_dict() in core does not output the up to date object
Jan 16, 2021
nicolae-stroncea
changed the title
.to_dict() in core does not output the up to date object
Method .to_dict() in core does not output the up to date object
Jan 16, 2021
nicolae-stroncea
changed the title
Method .to_dict() in core does not output the up to date object
Method .to_dict() in core does not output the up to date object
Jan 16, 2021
This is my model:
This is the route:
Issue: If I execute this code, the logger and the create response will output a null id:
Expectation: Once we perform the commit, the object properties are available. I've confirmed this by printing/logging the id of the person using
person.id
, and it outputs the correct value.to_dict()
outputs null instead of the correct value. It doesn't seem to have the committed object.Interestingly enough if I uncomment the
logger.info
line, or if I add db.session.refresh(), theto_dict()
outputs the correct result.This is the result when I execute it with the line
# logger.info(f"id: ",person.id)
uncommented.The text was updated successfully, but these errors were encountered: