-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Other than your return statement being badly indented in this example (I'm assuming it isn't in the actual source file) all of it looks just fine to me.
View resolution happens before the request - Pyramid sets it up when the application starts, so the view is either configured, or it isn't and running code inside the view shouldn't affect that (unless you intentionally raise a HTTPNotFound() exception). Jojo <[email protected]> writes: > hi guys, I'm using Pyramid and I'm trying to use Google Spreadsheet > API inside a view of mine to retrieve a list of spreadsheets. > first the user get a token from google and this works well, after > google call my view passing the token in the token parameter. > in the view i make a check for the token parameter, if it exist I make > a call to Google API, but I get a 404 error. > I think this happen because google object make a new http request > within another request. am I right? > > if I'm wrong, can someone direct me to the solution? > > > this is the code of my view: > > > def statistics_view(request): > feed = None > token = None > if 'token' in request.params: > token = request.params['token'] > print "TOKEN: "+token > gd_client = gdata.spreadsheet.service.SpreadsheetsService() > gd_client.auth_token = token > feed = gd_client.GetSpreadsheetsFeed() > > return {'google_spreadsheets_feed': feed} - -- Parnell "ixmatus" Springmeyer (http://ixmat.us) -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJN93sGAAoJEPvtlbpI1POLosYH+wRC0vNh5/Ffzpa7xzNISiaS xohQQ7d/oJhHLfkc6TMcI9WDPa91UvvBI4Z7WPt/Lv3Uqq2soy58BY/koI0LTGDu tu+Im8O8RLbVewx9qfssEvkYobGqLX7lQtdsbrIRxLzbvSO97I43Pi0sta1A8+iw R/pzeW4Hwv+u6uBVCI3RwISt+n4utYbj635cxLd/8OyrmtygG+qCHNCg26LfBh6C ApXfhyO5lRETmxV/WqrXeOllnWQB/rOdfTJu8dweus/vkr8BSxDIf4FRo4VdlCgB oJipYR6CODmxmCflzEgD+dBVG0ouk4NZigv+JgHHhsNaxsVm9kdyVSyaRiZ9kQ4= =GB4L -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
