summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-02-14 23:43:40 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-02-14 23:43:40 +0000
commita83f643c8171d05eda3e6dcdda1aa47a4de69766 (patch)
treed637e866ec356d394011c6012d96f4a32c83ffb6 /lib/sqlalchemy/orm/interfaces.py
parentded4e1d76b634b94a161bc91a3b4eb9d8777332b (diff)
downloadsqlalchemy-a83f643c8171d05eda3e6dcdda1aa47a4de69766.tar.gz
Gave the "state" internals a good solid
cleanup with less complexity, datamembers, method calls, blank dictionary creates.
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
-rw-r--r--lib/sqlalchemy/orm/interfaces.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py
index 75f9d4438..579101f0d 100644
--- a/lib/sqlalchemy/orm/interfaces.py
+++ b/lib/sqlalchemy/orm/interfaces.py
@@ -634,9 +634,10 @@ class StrategizedProperty(MapperProperty):
"""A MapperProperty which uses selectable strategies to affect
loading behavior.
- There is a single default strategy selected by default. Alternate
+ There is a single strategy selected by default. Alternate
strategies can be selected at Query time through the usage of
``StrategizedOption`` objects via the Query.options() method.
+
"""
def __get_context_strategy(self, context, path):
@@ -661,10 +662,12 @@ class StrategizedProperty(MapperProperty):
return strategy
def setup(self, context, entity, path, adapter, **kwargs):
- self.__get_context_strategy(context, path + (self.key,)).setup_query(context, entity, path, adapter, **kwargs)
+ self.__get_context_strategy(context, path + (self.key,)).\
+ setup_query(context, entity, path, adapter, **kwargs)
def create_row_processor(self, context, path, mapper, row, adapter):
- return self.__get_context_strategy(context, path + (self.key,)).create_row_processor(context, path, mapper, row, adapter)
+ return self.__get_context_strategy(context, path + (self.key,)).\
+ create_row_processor(context, path, mapper, row, adapter)
def do_init(self):
self.__all_strategies = {}
@@ -835,7 +838,8 @@ class PropertyOption(MapperOption):
mappers.append(prop.parent)
key = prop.key
else:
- raise sa_exc.ArgumentError("mapper option expects string key or list of attributes")
+ raise sa_exc.ArgumentError("mapper option expects string key "
+ "or list of attributes")
if current_path and key == current_path[1]:
current_path = current_path[2:]