Jump to content

Create/Query same entity


tokejepsen

Recommended Posts

Hey,

I thought when you query, the data in memory got queried as well?

I'm trying to do something like this:
 

entity = session.create(

"Sequence", {"parent": project, "name": "sq001"}

)

print session.query('Sequence where parent.id is "{0}" and name is "sq001"'.format(project["id"])).first()

 

But I seem to have to commit the session inbetween, so I'm guessing the query method only looks at the server?

 

entity = session.create(

"Sequence", {"parent": project, "name": "sq001"}

)

session.commit()

print session.query('Sequence where parent.id is "{0}" and name is "sq001"'.format(project["id"])).first()

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...