I think I'm answering myself:

address = Address(args) # passing jack's id
session.add(address)
session.commit()


2013/4/27 Mauricio de Abreu Antunes <[email protected]>

> Being more specific I talk about this part:
>
> >>> jack = User('jack', 'Jack Bean', 'gjffdd')>>> jack.addresses[]
>
> >>> jack.addresses = [...                 
> >>> Address(email_address='[email protected]'),...                 
> >>> Address(email_address='[email protected]')]
>
>
> Are addresses automaticamente added and commited?
> I know it is commiting jack and jack has addresses, but how do i add jack
> first (session 1) and right after commiting jack without addresses add a
> set of addresses and commit them to the database?
>
> 2013/4/26 Mauricio de Abreu Antunes <[email protected]>
>
>> Everytime I code SQLAlchemy relationships I note that insert operation
>> like this (tutorial) does not need commit()
>>
>> http://docs.sqlalchemy.org/en/latest/orm/tutorial.html#working-with-related-objects
>>
>> When using this bidirectional relationship() is the data automatically
>> commited to the dabase?
>>
>> Probably this is an easy question but I can not get how to perform a
>> rollback in jack.addresses.
>>
>> --
>> *Mauricio de Abreu Antunes*
>> Mobile: (51)930-74-525
>> Skype: mauricio.abreua
>>
>
>
>
> --
> *Mauricio de Abreu Antunes*
> Mobile: (51)930-74-525
> Skype: mauricio.abreua
>



-- 
*Mauricio de Abreu Antunes*
Mobile: (51)930-74-525
Skype: mauricio.abreua

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to