Try adding ?debug=t to your database connectionURI to see what queries 
it's trying to run.
Take a look at your database tables and field names.

Try using pollOption instead of poll_option in Response.

--
Rick

On Thu, 20 Jul 2006, Donald Ball wrote:

> Hey guys, nice little ORM library you've got here. One question - I'm
> trying to switch one of my joins from MultipleJoin to SQLMultipleJoin so i
> can count() and filter() the results. model.py:
>
> class PollOption(SQLObject):
>     poll = ForeignKey("Poll")
>     value = UnicodeCol(dbName="option_value")
>     responses = SQLMultipleJoin('Response')
>
> class Response(SQLObject):
>     poll_option = ForeignKey("PollOption")
>     datetime = DateTimeCol(default=datetime.now)
>     ip_address = UnicodeCol(length=15, varchar=0)
>     token = ForeignKey("Token")
>
> I just changed the responses property from MultipleJoin to
> SQLMultipleJoin... and now I get an error when I access the responses
> property:
>
>>>> option.responses
> Traceback (most recent call last):
>   File "<console>", line 1, in ?
>   File "<string>", line 1, in <lambda>
>   File
> "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/joins.py",
> line 144, in performJoin
>     results = self.otherClass.select(getattr(self.otherClass.q,
> self.soClass.sqlmeta.style.dbColumnToPythonAttr(self.joinColumn)) ==
> inst.id)
>   File
> "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/sqlbuilder.py",
> line 362, in __getattr__
>     self.soClass.sqlmeta.columns[attr].dbName,
> KeyError: 'pollOptionID'
>
> I dropped and recreated the database, same deal. What am I doing wrong?
>
> - donald
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> sqlobject-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to