On Apr 14, 2008, at 7:44 AM, Koen Bok wrote:

>
> Hey All,
>
> I was upgrading our app from 0.4.1 to 0.4.5 and this code broke:
>
> pg_user = Table('pg_user', metadata,
>       Column('usesysid', Integer, primary_key=True),
>       Column('usename', Unicode(), unique=True))
>
> pg_group = Table('pg_group', metadata,
>       Column('grosysid', Integer, primary_key=True),
>       Column('groname', Unicode(), unique=True),
>       Column('grolist', PGArray(unicode)))
>
> mapper(PGUser, pg_user, properties={
>       'groups': relation(PGGroup, viewonly=True,
>               primaryjoin=pg_user.c.usesysid==func.any(pg_group.c.grolist),
>               foreign_keys=[pg_group.c.grolist])})
>
> "Specify the foreign_keys argument to indicate which columns on the
> relation are foreign." % (self.primaryjoin, self))
> ArgumentError: Could not determine relation direction for primaryjoin
> condition 'pg_user.usesysid = any(pg_group.grolist)', on relation
> PGUser.groups (PGGroup). Specify the foreign_keys argument to indicate
> which columns on the relation are foreign.
>
> I found this post(1) so I tried upgrading to SVN, but I still got the
> error. Does it have to do anything with the any() function and the
> PGArray column type?
>

nah I'd have to fix that for you.  We have a long standing trac ticket  
for supporting functions/CAST within primaryjoin conditions, which  
don't really work, so again im completely surprised that relation  
worked for you.   Use a plain descriptor perhaps ?  (though ill try to  
see if it can be made to work again)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to