From 6dd05dfb00cca205ffdcf6bdddcd77f368249ebb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 7 May 2007 00:40:41 +0000 Subject: [PATCH] - session.get() and session.load() propigate **kwargs through to query --- CHANGES | 1 + lib/sqlalchemy/orm/session.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 43c4ab88f5..64f59d05c0 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ - many-to-many relationships check that the number of rows deleted from the association table by a delete operation matches the expected results + - session.get() and session.load() propigate **kwargs through to query - mysql - support for column-level CHARACTER SET and COLLATE declarations, as well as ASCII, UNICODE, NATIONAL and BINARY shorthand. diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 1880e6062c..00ca7cde78 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -314,8 +314,8 @@ class Session(object): query. """ - entity_name = kwargs.get('entity_name', None) - return self.query(class_, entity_name=entity_name).get(ident) + entity_name = kwargs.pop('entity_name', None) + return self.query(class_, entity_name=entity_name).get(ident, **kwargs) def load(self, class_, ident, **kwargs): """Return an instance of the object based on the given @@ -332,8 +332,8 @@ class Session(object): query. """ - entity_name = kwargs.get('entity_name', None) - return self.query(class_, entity_name=entity_name).load(ident) + entity_name = kwargs.pop('entity_name', None) + return self.query(class_, entity_name=entity_name).load(ident, **kwargs) def refresh(self, obj): """Reload the attributes for the given object from the -- 2.47.2