I got an error while trying to use associative proxy.
I got a mapped class A, with a ratio of 0-n to B. B has a relationship of 0-n to C. Connection_proxy must access A from C.
class C(base): a = association_proxy('b', 'a')
It works without problems, if it really is related to B. But if this relation is null , then trying to access myCinstance.a throws a: AttributeError 'NoneType' object has no attribute 'a' . I think this works well with the 1-n ratio, but is there a way myCinstance.a returns None instead of an error? (I saw the creator option, but it only looks for customization, not for getting).
Thanks in advance.
Im using SqlAlchemy 0.7.5
EDIT : I came up with a simple example describing the problem https://gist.github.com/2225046
tonio source share