On Tue, 20 Mar 2007 at 13:04, Diez B. Roggisch wrote:
> On Tuesday 20 March 2007 12:30, Jorge Godoy wrote:
>> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>>> You stumbled over one of the less-intuitive corners of SO, which I
>>> personalyl don't understand either - there should be ways to implement
>>> that different.
>>>
>>> However, in the moment you have to do it like this:
>>>
>>> accounts = MTAccount.select(MTAccount.q.userID ==
>>> identity.current.user.id)
>>
>> Hmmm... I don't remember if it has to be like that or in newer versions
>> you can ommit the "id"s. I believe that with newer versions it is
>> possible. At least, out of identity, it looks like it is possible.
>
> You are right, with 8.0 it works. But it might be that the 7.x-series doesn't
> support it, until recently.
accounts = MTAccount.select(MTAccount.q.user == identity.current.user)
gives:
File
"/var/www/finance.bitdance.com/moneytracker/lib/python2.4/SQLObject-0.8.1-py2.4.egg/sqlobject/sqlbuilder.py",
line 381, in __getattr__
raise AttributeError("%s instance has no attribute '%s'" %
(self.soClass.__name__, attr))
AttributeError: MTAccount instance has no attribute 'user'
while:
accounts = MTAccount.select(MTAccount.q.userID == identity.current.user)
gives:
File
"/var/www/finance.bitdance.com/moneytracker/lib/python2.4/SQLObject-0.8.1-py2.4.egg/sqlobject/converters.py",
line 235, in sqlrepr
raise ValueError, "Unknown SQL builtin type: %s for %s" % \
ValueError: Unknown SQL builtin type: <class
'moneytracker.identity.model.User'> for <User 1 user_name=u'bitdancer'
email_address="u'[EMAIL PROTECTED]'" display_name=u'bitdancer'
password=u'testthis' created='datetime.datetime...)'>
which is all as it was before I upgraded to 8.1. But:
accounts = MTAccount.select(MTAccount.q.userID == identity.current.user.id)
works, and that solves my problem, but I wonder what I'm doing wrong
that what works for you guys in 8.0 doesn't work for me in 8.1?
--David
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---