just assign to the same variable name. query = guery.filter(Foo.x == 1) The generative queries are a feature.
Making the queries mutable would allow functions to modify queries and complicate debugging. You can have functions return the modified query, or have functions return the expressions to be applied. What is the benefit you seek from mutable queries? On Monday, December 28, 2015 at 6:19:01 AM UTC-5, Chris Withers wrote: > > Hi All, > > Is there anything I can do to make Query instance non-generative? > > query = session.query(Foo) > query.filter(Foo.x==1) > > ...and have the query actually be modified rather than returning a new > query with the clause added? > > cheers, > > Chris > -- 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 https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.