summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/strategies.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/strategies.py')
-rw-r--r--lib/sqlalchemy/orm/strategies.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py
index d95f17f64..8a4c8e731 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -105,6 +105,8 @@ class UninstrumentedColumnLoader(LoaderStrategy):
if the argument is against the with_polymorphic selectable.
"""
+ __slots__ = 'columns',
+
def __init__(self, parent):
super(UninstrumentedColumnLoader, self).__init__(parent)
self.columns = self.parent_property.columns
@@ -128,6 +130,8 @@ class UninstrumentedColumnLoader(LoaderStrategy):
class ColumnLoader(LoaderStrategy):
"""Provide loading behavior for a :class:`.ColumnProperty`."""
+ __slots__ = 'columns', 'is_composite'
+
def __init__(self, parent):
super(ColumnLoader, self).__init__(parent)
self.columns = self.parent_property.columns
@@ -176,6 +180,8 @@ class ColumnLoader(LoaderStrategy):
class DeferredColumnLoader(LoaderStrategy):
"""Provide loading behavior for a deferred :class:`.ColumnProperty`."""
+ __slots__ = 'columns', 'group'
+
def __init__(self, parent):
super(DeferredColumnLoader, self).__init__(parent)
if hasattr(self.parent_property, 'composite_class'):
@@ -225,7 +231,8 @@ class DeferredColumnLoader(LoaderStrategy):
(
loadopt and
'undefer_pks' in loadopt.local_opts and
- set(self.columns).intersection(self.parent.primary_key)
+ set(self.columns).intersection(
+ self.parent._should_undefer_in_wildcard)
)
or
(
@@ -300,6 +307,8 @@ class LoadDeferredColumns(object):
class AbstractRelationshipLoader(LoaderStrategy):
"""LoaderStratgies which deal with related objects."""
+ __slots__ = 'mapper', 'target', 'uselist'
+
def __init__(self, parent):
super(AbstractRelationshipLoader, self).__init__(parent)
self.mapper = self.parent_property.mapper
@@ -316,6 +325,8 @@ class NoLoader(AbstractRelationshipLoader):
"""
+ __slots__ = ()
+
def init_class_attribute(self, mapper):
self.is_class_level = True
@@ -343,6 +354,10 @@ class LazyLoader(AbstractRelationshipLoader):
"""
+ __slots__ = (
+ '_lazywhere', '_rev_lazywhere', 'use_get', '_bind_to_col',
+ '_equated_columns', '_rev_bind_to_col', '_rev_equated_columns')
+
def __init__(self, parent):
super(LazyLoader, self).__init__(parent)
join_condition = self.parent_property._join_condition
@@ -661,6 +676,8 @@ class LoadLazyAttribute(object):
@properties.RelationshipProperty.strategy_for(lazy="immediate")
class ImmediateLoader(AbstractRelationshipLoader):
+ __slots__ = ()
+
def init_class_attribute(self, mapper):
self.parent_property.\
_get_strategy_by_cls(LazyLoader).\
@@ -684,6 +701,8 @@ class ImmediateLoader(AbstractRelationshipLoader):
@log.class_logger
@properties.RelationshipProperty.strategy_for(lazy="subquery")
class SubqueryLoader(AbstractRelationshipLoader):
+ __slots__ = 'join_depth',
+
def __init__(self, parent):
super(SubqueryLoader, self).__init__(parent)
self.join_depth = self.parent_property.join_depth
@@ -1069,6 +1088,9 @@ class JoinedLoader(AbstractRelationshipLoader):
using joined eager loading.
"""
+
+ __slots__ = 'join_depth',
+
def __init__(self, parent):
super(JoinedLoader, self).__init__(parent)
self.join_depth = self.parent_property.join_depth