On Fri, Aug 23, 2013 at 12:11:39PM -0700, Jonathan Vanasco wrote:

> i think a simple fix could be something like this ( line 240, 
> sqlalchemy/ext/associationproxy.py 
> )
> 
>         if self.scalar:
> -            if not getattr(obj, self.target_collection)
> -            return self._scalar_get(getattr(obj, self.target_collection))
>         else:
> 
>         if self.scalar:
> +            proxied = getattr(obj, self.target_collection)
> +            if not proxied :
> +                return None
> +            return self._scalar_get(proxied)
>       else:

We're monkey-patching AssociationProxy.__get__ with the same change
since SQLA 0.5.x, so it would be nice to get it applied upstream...
Maybe in 0.9?

Gabor

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to