summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/state.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-07-16 17:29:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-07-16 17:29:02 -0400
commitce9a702dbd52946487f45b98ef20d1b7783facb6 (patch)
tree7273a1982850bf9975509295d766053d4fe822b1 /lib/sqlalchemy/orm/state.py
parent1dc09bf6ede97ef08b2c8c0886a03b44bba735ff (diff)
downloadsqlalchemy-ce9a702dbd52946487f45b98ef20d1b7783facb6.tar.gz
- express most of the orm.util functions in terms of the inspection system
- modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
Diffstat (limited to 'lib/sqlalchemy/orm/state.py')
-rw-r--r--lib/sqlalchemy/orm/state.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py
index ea0e89caf..2b846832e 100644
--- a/lib/sqlalchemy/orm/state.py
+++ b/lib/sqlalchemy/orm/state.py
@@ -13,7 +13,7 @@ defines a large part of the ORM's interactivity.
import weakref
from .. import util
-from . import exc as orm_exc, attributes, util as orm_util
+from . import exc as orm_exc, attributes, util as orm_util, interfaces
from .attributes import (
PASSIVE_NO_RESULT,
SQL_OK, NEVER_SET, ATTR_WAS_SET, NO_VALUE,\
@@ -24,7 +24,7 @@ instrumentation = util.importlater("sqlalchemy.orm", "instrumentation")
mapperlib = util.importlater("sqlalchemy.orm", "mapperlib")
-class InstanceState(object):
+class InstanceState(interfaces._InspectionAttr):
"""tracks state information at the instance level."""
session_id = None
@@ -39,6 +39,8 @@ class InstanceState(object):
deleted = False
_load_pending = False
+ is_instance = True
+
def __init__(self, obj, manager):
self.class_ = obj.__class__
self.manager = manager