summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-05-07 00:40:41 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-05-07 00:40:41 +0000
commit6dd05dfb00cca205ffdcf6bdddcd77f368249ebb (patch)
tree930364522d0ee8bf7dba29f96166b287f9e3652a
parentcea2e8fa64a52c96607bc20f1a5f5b5b16245787 (diff)
downloadsqlalchemy-6dd05dfb00cca205ffdcf6bdddcd77f368249ebb.tar.gz
- session.get() and session.load() propigate **kwargs through to query
-rw-r--r--CHANGES1
-rw-r--r--lib/sqlalchemy/orm/session.py8
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 43c4ab88f..64f59d05c 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 1880e6062..00ca7cde7 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