Is worse than that. I simply don't use the add() method in any line.
There's no add() method being executed. But a commit() saves all the objects in the database. Seems that sqlalchemy is executing add() method in background... []s Gil Em quarta-feira, 10 de junho de 2015 15:44:06 UTC-3, Michael Bayer escreveu: > > > > On 6/10/15 2:22 PM, Gilcan Machado wrote: > > Hi. > > I'm dealing with a weid situation: > > My 'session' is loaded with objects, and when I commit all the objects are > saved in the database, but without any execution of add() method. > > How is this possible. > > It's a problem to me because I'm creating a lot of objects and return it > as a list to another method. The method filters the list and add() to the > session only what is important. > > But when I execute commit() all the objects are inserted. > > What I'm doing wrong? > > What should I read to understand better the situation. > > > hard to say without specifics, but if you are adding some things and not > others, probably cascade is taking place along relationships. > > > http://docs.sqlalchemy.org/en/rel_1_0/orm/cascades.html > > > > []s > Gil > > -- > 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 sqlalchemy+...@googlegroups.com <javascript:>. > To post to this group, send email to sqlal...@googlegroups.com > <javascript:>. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > > > -- 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.