Re: [SQLObject] MultipleJoin inactive in version 0.6
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Max I. <ma...@uc...> - 2004-11-02 14:30:46
|
Nigel King wrote: > 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' > joinedColumn='tape_title_id' did not work but joinedColumn='id' did work. Sorry. You'd to use 'artist_id' instead. >>> =======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', joinColumn='artist_id') >> >>> class TapeTitle(SQLObject): >>> _connection = conn >>> artist = ForeignKey('Artist') >> IMO, either the docs must be updated or, better yet, SQLobject should >> somehow figure out that joinedColumn argument by itself. |