On 08/26/2016 04:42 PM, adaptable (Metaframework) wrote:
Hi all,
this comment on Github is well formatted:

https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334

I see the wrong |todo.id| after the commit (a log string instead |1|)

|

|[...]
2016-08-2621:36:56,071INFO sqlalchemy.engine.base.EngineCOMMIT
######### before commit - id:  None
2016-08-2621:36:56,073INFO sqlalchemy.engine.base.EngineBEGIN(implicit)
2016-08-2621:36:56,073INFO sqlalchemy.engine.base.EngineINSERT INTO todo
(description,done,user_id)VALUES (?,?,?)
2016-08-2621:36:56,073INFO sqlalchemy.engine.base.Engine('TODO
test',None,None)
2016-08-2621:36:56,074INFO sqlalchemy.engine.base.EngineCOMMIT
######### after commit - id: 2016-08-26 21:36:56,075 INFO
sqlalchemy.engine.base.Engine BEGIN (implicit)
2016-08-2621:36:56,076INFO sqlalchemy.engine.base.EngineSELECT todo.id
AS todo_id,todo.description AS todo_description,todo.doneAS
todo_done,todo.user_id AS todo_user_id
FROM todo
WHERE todo.id =?
2016-08-2621:36:56,076INFO sqlalchemy.engine.base.Engine(1,)
1
2016-08-2621:36:56,077INFO sqlalchemy.engine.base.EngineSELECT todo.id
AS todo_id,todo.description AS todo_description,todo.doneAS
todo_done,todo.user_id AS todo_user_id
FROM todo
2016-08-2621:36:56,077INFO sqlalchemy.engine.base.Engine()
1TODO test|

|

running this code on MAC (Python 2.7.10) with SQLAlchemy version 1.0.14

https://github.com/rognoni/adaptable/blob/master/Backend/Python-Flask/storage/sqlalchemy_sqlite.py

|

[...]
    ### test
    session =db_schemas.examples.session()
    todo =db_schemas.examples.classes.todo(description="TODO test")
    session.add(todo)
    print"######### before commit - id: ",todo.id
    session.commit()
    print"######### after commit - id: ",todo.id

    forinstance insession.query(db_schemas.examples.classes.todo):
        printinstance.id,instance.description

|

Using the query the |instance.id| is correct: |1|

Hi there -

Unfortunately I still don't see what we're talking about. This code example appears to rely upon an entire custom application which is not something we have the resources to debug on a mailing list.

If you can provide a succinct, single file, fully runnable (in one file, no imports outside of SQLAlchemy) example per the guidelines at http://stackoverflow.com/help/mcve that would help illustrate what you're trying to do.





|
|

--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sqlalchemy+unsubscr...@googlegroups.com
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to