chaouche yacine wrote:
> --- On Sun, 11/22/09, Conor 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
>
--- On Sun, 11/22/09, Conor 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.
> -Conor
I don't know, it
chaouche yacine wrote:
> --- On Fri, 11/20/09, Conor 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 use
--- On Fri, 11/20/09, Conor 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 used this recipe and cha
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
> rela
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 relatio
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))
City(