[Sqlalchemy-tickets] Issue #3235: Association proxy "init" does not work symmetrically (zzzeek/sqla
Brought to you by:
zzzeek
|
From: Boris K. <iss...@bi...> - 2014-10-28 14:18:04
|
New issue 3235: Association proxy "init" does not work symmetrically https://bitbucket.org/zzzeek/sqlalchemy/issue/3235/association-proxy-init-does-not-work Boris Kozinsky: For some reason when I try to define association proxy in the user-keyword example, it only works in one direction but not the other, even if I define the association proxies symmetrically (please see attached code). For instance, I can do user1.keywords.append(keyword1) but not keyword1.users.append(user1). The second one will give a "Key Error". I traced this behavior to the order of arguments in the UserKeyword.__init__ method. The behavior is correct only one way, depending on the argument order, but never both ways. It is somewhat hard to know the right order of arguments for the collection to work... |