Steve Bergman wrote:
On Jan 6, 7:18 pm, "glenn" <[EMAIL PROTECTED]> wrote:

> I notice many people pass in key value pairs, but, well... I dont want
> to have to - It seems I can almost get away with just passing in the
> object (p) and I'd like to make this work.
>

You can turn most data model objects into dictionaries with jsonify.
This is what I do.


from turbojson.jsonify import jsonify

p_dict = jsonify(p)
Hi Steve
In the instance of editing an existing project (p=Project.get(id)) this
works, but then it was already working for an existing project. But if
p='', or p=Project - then this breaks. If the first instance because I
guess you cant jsonify 0 length string and in the second I get "No
Applicable Methods"

Thanks though  - I still dont get why I cant just pass in values=p

glenn


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