summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/langhelpers.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-28 20:06:12 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-28 20:06:49 -0400
commitc192e447f3a5e8bfaaa46097eb4d6179f056361c (patch)
tree4c834538728c9fa22f1c9c1cd065d2e2bb44f930 /lib/sqlalchemy/util/langhelpers.py
parentfa5522547150687c9b3cd41d28df08ab0512b5b2 (diff)
downloadsqlalchemy-c192e447f3a5e8bfaaa46097eb4d6179f056361c.tar.gz
- major refactoring/inlining to loader.instances(), though not really
any speed improvements :(. code is in a much better place to be run into C, however - The ``proc()`` callable passed to the ``create_row_processor()`` method of custom :class:`.Bundle` classes now accepts only a single "row" argument. - Deprecated event hooks removed: ``populate_instance``, ``create_instance``, ``translate_row``, ``append_result`` - the getter() idea is somewhat restored; see ref #3175
Diffstat (limited to 'lib/sqlalchemy/util/langhelpers.py')
-rw-r--r--lib/sqlalchemy/util/langhelpers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py
index 828e8f1f3..f0dd7a08e 100644
--- a/lib/sqlalchemy/util/langhelpers.py
+++ b/lib/sqlalchemy/util/langhelpers.py
@@ -1249,3 +1249,11 @@ def chop_traceback(tb, exclude_prefix=_UNITTEST_RE, exclude_suffix=_SQLA_RE):
return tb[start:end + 1]
NoneType = type(None)
+
+def attrsetter(attrname):
+ code = \
+ "def set(obj, value):"\
+ " obj.%s = value" % attrname
+ env = locals().copy()
+ exec(code, env)
+ return env['set']