--- On Sun, 11/22/09, Conor conor.edward.da...@gmail.com wrote:
There is a problem with your code when the tag is in the
cache: if the
tag is added to the session via session.add or a relation
add cascade,
SQLAlchemy will try to INSERT the tag into the database on
the next
flush.
chaouche yacine wrote:
--- On Sun, 11/22/09, Conor conor.edward.da...@gmail.com wrote:
There is a problem with your code when the tag is in the
cache: if the
tag is added to the session via session.add or a relation
add cascade,
SQLAlchemy will try to INSERT the tag into the database on
--- On Fri, 11/20/09, Conor conor.edward.da...@gmail.com wrote:
Also, there is a recipe that looks for a matching object in
the session
before querying the database:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject
-Conor
Thank you Conor for you useful pointer. I have
chaouche yacine wrote:
--- On Fri, 11/20/09, Conor conor.edward.da...@gmail.com wrote:
Also, there is a recipe that looks for a matching object in
the session
before querying the database:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject
-Conor
Thank you Conor for
Hello,
This is the first time I try an ORM, and I chose SQLAlchemy, which is popular
amongst pythonistas.
Since I am a complete beginner, here's my beginner's two cents question :
Suppose you have a very basic model like this (pseudo code) :
User(firstname,lastname,nick,ManyToOne(city))
chaouche yacine wrote:
But how can I be sure that the city of New Jersey will be inserted before
the user in the database so that the new user row will get the proper city
id ?
SQLAlchemy takes care of that automatically once you configure the
relationship between user and city using
Michael Bayer wrote:
chaouche yacine wrote:
But how can I be sure that the city of New Jersey will be inserted before
the user in the database so that the new user row will get the proper city
id ?
SQLAlchemy takes care of that automatically once you configure the
relationship