Em Saturday 03 November 2007 18:25:25 JimHat escreveu:
>
> ----
> File "model.py", line 126, in score
> return sum( [v.score for v in Vote.select( Vote.q.site == self.id)] )
> File
> "/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg/sqlobject/sqlbu
>ilder.py", line 381, in __getattr__
> raise AttributeError("%s instance has no attribute '%s'" %
> (self.soClass.__name__, attr))
> AttributeError: Vote instance has no attribute 'site'
> Error location in template file 'templates/site.kid'
> between line 8 and line 9:
> <body>
> Site: ${site.url} with score: [b]${site.score()}[/b][/quote]
> ----
Reading SQLObject's docs you'll see that you'll have to
use "model.Vote.q.siteID" (or "siteId", I never remember from the top of my
head...).
You can also find this out using "dir(model.Vote)".
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---