Robert,

robert rottermann wrote:
...
> however I would like to change the assignMyselfToCompany method in a way that 
> I
> could achieve the same with:
>
> product = tblProducts_kl()
> product.assignMyselfToCompany(company_id)
>   
Unless you do some more things in your assignMyselfToCompany I think you 
can just do:

product = tblProducts_kl()
company.productRelation = product
or probably more likely this as I assume a company can have more then 
one product.
company.productRelation.append(product)

And SA doe the magic for you.

See:
http://www.sqlalchemy.org/docs/05/ormtutorial.html#adding-new-objects

particularly Working with Related Objects

Hope this helps
Werner



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to