Re: [SQLObject] MultipleJoin inactive in version 0.6
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nigel K. <nig...@or...> - 2004-11-02 13:46:39
|
Max, Thanks very much. Unfortunately the error doesn't go away it still doesn't seem to think that titles exists Traceback (most recent call last): File "temp.py", line 16, in ? print Artist.get(1).titles AttributeError: 'Artist' object has no attribute 'titles' print Artist.get(1).tapeTitles[0].Title works which is a little long winded joinedColumn='tape_title_id' did not work but joinedColumn='id' did work. I am not very expert in Python but this package appears to be getting more complicated rather than less complicated. Nigel King On 2 Nov 2004, at 11:25, Max Ischenko wrote: > Nigel King wrote: > >> Hi, >> The relation in MultipleJoin does not seem to work in version 0.6. >> The following simplified program gives the Traceback error below > > Been there. > > Add joinColumn argument: > >> =======temp.py======= >> from sqlobject import * >> #conn = MySQLConnection(user='nigelk', db='music') >> conn = 'mysql://nigelk@localhost/music' >> class Artist(SQLObject): >> _connection = conn >> Name = StringCol() >> titles = MultipleJoin('TapeTitle') > titles = MultipleJoin('TapeTitle', joinColumn='tape_title_id') > >> class TapeTitle(SQLObject): >> _connection = conn >> artist = ForeignKey('Artist') >> Title = StringCol() >> worked under 0.5.2 I understand that we now need get although this >> was not obvious in the documentation > > IMO, either the docs must be updated or, better yet, SQLobject should > somehow figure out that joinedColumn argument by itself. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > |