diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-08 20:51:51 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-08 20:51:51 +0000 |
commit | 06b8c73ad5136f615957bdf4e535330885ae1635 (patch) | |
tree | b3f59c9d1083e4a126425e0c09fca844f0b675c8 /lib/sqlalchemy/util.py | |
parent | 3aa4dd6f2b4e3ba80706960ecb8a988087f9a573 (diff) | |
download | sqlalchemy-06b8c73ad5136f615957bdf4e535330885ae1635.tar.gz |
serious overhaul to get eager loads to work inline with an inheriting mapper, when the inheritance/eager loads share the same table. mapper inheritance will also favor the columns from the child table over those of the parent table when assigning column values to object attributes. "correlated subqueries" require a flag "correlated=True" if they are in the FROM clause of another SELECT statement, and they want to be correlated. this flag is set by default when using an "exists" clause.
Diffstat (limited to 'lib/sqlalchemy/util.py')
-rw-r--r-- | lib/sqlalchemy/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 7115dbcec..d60166a0c 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -7,6 +7,7 @@ __all__ = ['OrderedProperties', 'OrderedDict', 'generic_repr', 'HashSet', 'AttrProp'] import thread, threading, weakref, UserList, time, string, inspect, sys from exceptions import * +import __builtin__ def to_list(x): if x is None: @@ -24,6 +25,18 @@ def to_set(x): else: return x +def reversed(seq): + try: + return __builtin__.reversed(seq) + except: + def rev(): + i = len(seq) -1 + while i >= 0: + yield seq[i] + i -= 1 + raise StopIteration() + return rev() + class AttrProp(object): """a quick way to stick a property accessor on an object""" def __init__(self, key): |