Hi, i was trying this technique but i'm getting this traceback when
using gae_google_account:
Traceback (most recent call last):
File "/Users/lauer/web2py/gluon/restricted.py", line 178, in restricted
exec ccode in environment
File
"/Users/lauer/web2py/applications/web2pytodo/controllers/default.py:user",
line 56, in <module>
File "/Users/lauer/web2py/gluon/globals.py", line 96, in <lambda>
self._caller = lambda f: f()
File
"/Users/lauer/web2py/applications/web2pytodo/controllers/default.py:user",
line 35, in user
File "/Users/lauer/web2py/gluon/tools.py", line 966, in __call__
return self.login()
File "/Users/lauer/web2py/gluon/tools.py", line 1419, in login
self.log_event(log % self.user)
File "/Users/lauer/web2py/gluon/tools.py", line 1180, in log_event
origin=origin, user_id=user_id)
File "/Users/lauer/web2py/gluon/contrib/gql.py", line 281, in insert
self._last_reference = tmp
File "/Users/lauer/web2py/gluon/sql.py", line 1611, in __setattr__
raise SyntaxError, 'Object exists and cannot be redefined: %s' % key
SyntaxError: Object exists and cannot be redefined: _last_reference
On Mon, Jun 28, 2010 at 7:04 AM, dlypka <[email protected]> wrote:
> OK I downloaded the trunk and tested this mod.
>
> myParent = db.ParentTable.insert(name='Bill')
> myParentNativeRef = myParent._table._last_reference
>
> works
>
> Thanks again.
>
> On Jun 27, 3:28 pm, mdipierro <[email protected]> wrote:
>> > Maybe just add a new property dynamically to the row
>> > We could call it 'nativeRef'
>>
>> > Would it be something like:
>> > self.nativeRef = tmp # Python can add new properties 'on-the-fly',
>> > right?
>>
>> > as the new 2nd last statement of insert()?
>>
>> If that is useful we can do it. I just did it in trunk so you can test
>> it but I called self._last_reference to avoid possible naming
>> conflicts.
>>
>> Massimo
Any thoughts?