Hi,

I'm fairly new to SQLObject and I have a question about RelatedJoin: is it 
possible to use an alternateID as the data for the otherColumn.

I have something like the following

in the DB:
users table with columns id ( int) and username (char 8)

roles table with columns id (int) and name (char 8)

user_roles table with columns username and role_id

in the model.py:
class User(SQLObject):
                class sqlmeta:
                                table = 'users'
                username = UnicodeCol(alternateID=True, varchar=False, 
length=8,alternateMethodName='by_username')


class Role(SQLObject):
                class sqlmeta:
                                table = 'roles'
                name = UnicodeCol(varchar=False, length=8)

                users = RelatedJoin('User', intermediateTable='user_roles',
                         joinColumn='role_id', otherColumn='username')

but this isn't working because when I try to get role.users it attempts to find 
users whose ID is their username.

Is there a way for this to work using the user's alternateID username in the 
join table?

Thanks in advance,
Slaalo
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to