On Monday 24 November 2008 15:17:58 Vortexmind wrote:
> Well ... at last I've solved it :)
>
> I just escluded simplejson. What I did before
> (well no security checks, just to explain)
>
> ===============================
> import simplejson as json
> item = json.loads(request.POST.keys()[0])
> ...
> new_profile = Profile()
> new_profile.data = item
> ===============================
> This doesn't work, as generates the above problems.
>
> What I do now:
> ===============================
> item = request.POST.keys()[0]
> ...
> new_profile = Profile()
> new_profile.data = item
> ===============================
>
> And this works fine, my data get correctly stored, I can retrieve it
> with the load controller and once I get the string in javascript
> enviroment I just do
>       var objConf = JSON.decode(profilevar)
> to have back my nice object I started with :)
>
> Obviously all the above in production would include all the security
> checks to ensure the POST data is actually your nice json profile data
> and not "EXTERMINATE ALL FROM UNIVERSE WHERE=1" ;)

Which you could accomplish by parsing nonetheless using simplejson, but 
storing the original data.

Diez

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