diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-25 12:57:10 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-25 12:57:10 -0400 |
commit | 65a6e97906802237228ea359f33bb33f1ad4a2f9 (patch) | |
tree | d5e9755186315c3522a507c148489e85587e5cb7 /lib/sqlalchemy/ext/hybrid.py | |
parent | 7ab906e258eec23841c7f0c67266ebb337382277 (diff) | |
download | sqlalchemy-65a6e97906802237228ea359f33bb33f1ad4a2f9.tar.gz |
- hybrid_and
- move the update_wrapper to synonym for now, we can't assume the return value of hybrid.expr is an updateable wrapper
Diffstat (limited to 'lib/sqlalchemy/ext/hybrid.py')
-rw-r--r-- | lib/sqlalchemy/ext/hybrid.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index 609f5aa8e..e0b3dab48 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -90,7 +90,7 @@ class property_(object): def __get__(self, instance, owner): if instance is None: - return util.update_wrapper(self.expr(owner), self) + return self.expr(owner) else: return self.fget(instance) @@ -135,6 +135,9 @@ class Comparator(interfaces.PropComparator): # interesting.... return self - - -
\ No newline at end of file + +def hybrid_and(self): + if isinstance(self, type): + return expression.and_ + else: + return operator.and_ |