From 65a6e97906802237228ea359f33bb33f1ad4a2f9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 25 Aug 2010 12:57:10 -0400 Subject: - hybrid_and - move the update_wrapper to synonym for now, we can't assume the return value of hybrid.expr is an updateable wrapper --- lib/sqlalchemy/ext/hybrid.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/ext') 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_ -- cgit v1.2.1