From: Mike Bayer Date: Mon, 7 May 2007 00:40:41 +0000 (+0000) Subject: - session.get() and session.load() propigate **kwargs through to query X-Git-Tag: rel_0_3_8~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dd05dfb00cca205ffdcf6bdddcd77f368249ebb;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - session.get() and session.load() propigate **kwargs through to query --- 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