On 28 Gru, 20:19, "Michael Bayer" <mike...@zzzcomputing.com> wrote: > > query.get() doesn't work with filtering criterion. This because it looks > up in the current session by primary key, and if present issues no SQL. > If it were filtered, you'd get different results based on whether or not > the object were already loaded or not. It actually should be raising an > error as get() should be asserting that no existing filter criterion is > set up.
Have you considered making get(*primary_key_as_list) a synonym for filter_by(**primary_key_as_dict)? Then if a filtering criterion contains only a primary key, do a look up in the session. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.