Hey Josephine,

So there are two options:

   1. Recreate the old style token after you load the new style one back
   from App Engine, then use the old style token.
   2. Use the Spreadsheets v3 client,
gdata.spreadsheet*s*.client.SpreadsheetsClient,
   which uses the new style token, allowing you to avoid all of this token
   translation business.

Thanks,
-Vic



On Sat, Dec 11, 2010 at 3:10 PM, Josephine Feldhoff
<[email protected]>wrote:

> Hi Vic
>
> Thanks a lot. That was the one to get things saved.
>
> But in the next step when I try to use the token with my
> spreadsheet.service client I get the following error
>
> self.service_client.token_store 
> =gdata.gauth.AuthSubToken(tokenSpread.get_token_string(), 
> ['https://spreadsheets.google.com/feeds/'])
> AttributeError: 'AuthSubToken' object has no attribute 'get_token_string'
>
>
> The code I'm trying....
> client = gdata.spreadsheet.service.SpreadsheetsService()
> gdata.alt.appengine.run_on_appengine(service_client)
> token =  token = gdata.gauth.ae_load(current_user.user_id())
> client.token_store =tokenSpread
> client.auth_token = tokenSpread
> client.UpgradeToSessionToken()
>
> feed = self.service_client.GetSpreadsheetsFeed()
>
> Another variant
>
> client.token_store =gdata.gauth.AuthSubToken(token.get_token_string(), 
> ['https://spreadsheets.google.com/feeds/'])
>
> I cant figure out how to add the token . I've tried to figure out which
> version the service is using. The "old style" or the new one
>
>
>
>
> On Fri, Dec 10, 2010 at 22:41, Vic Fryzel <[email protected]> wrote:
>
>> Hey Josephine,
>>
>> Ah, I found the issue.  You're using the "old style" AuthSubToken class,
>> which is defined as gdata.auth.AuthSubToken, yet the method you're using
>> (ae_save()) uses the "new style" AuthSubToken class, which is defined as
>> gdata.gauth.AuthSubToken.  Note the g in gauth.
>>
>> Replace line 68 in what you sent me with this:
>> new_style_token = gdata.gauth.AuthSubToken(token.get_token_string(), ['
>> https://spreadsheets.google.com/feeds/'<https://spreadsheets.google.com/feeds/%27>
>> ])
>> gdata.gauth.ae_save(new_style_token, current_user.user_id())
>>
>> And you should be good to go.
>>
>> Thanks,
>> -Vic
>>
>
>
>
> --
> Co-founder and owner
> +46 704 330 764
> Cloudspot AB
> www.cloudspot.se
> Google Apps Authorized Reseller
>
>

Reply via email to