-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Thomas escreveu:
|
| My problem is that the array does not get properly deserialized into a
| Python object and I end up . I am using Mochikit's loadJSONDoc method
| to make the asynchronous call. In particular, I get an exception in
| the map portion of the doSomething Turbogears method saying that '['
| can't convert to an int.

(...)

| The turbogears method looks like this:
|     @expose(format="json")
|     def doSomething(self, checkedBoxes):
|         # Turn checkedBoxes into a list of integers
|         intVals = map(int, checkedBoxes)      # Fails here.
|         return dict(results=getMatches())

Use a validator instead of iterating through the list.

Remember that EVERYTHING you get from the web comes as a string /
unicode string.  There is no exception (so, your "[" is part of the
string).

- --
Jorge Godoy      <[EMAIL PROTECTED]>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkh4vV8ACgkQEzC+baSjBiW8JQCgjulEr9uIBdG4TgCtvq6W1oTy
RnYAnj9init8xA82Lix5/ONR07xV6SiY
=LkhL
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to