Hi, I have a question about the appropriate use of Colander to go from a 
python object to JSON

Let's say I have a django model called Person, and a schema called 

Would this be an appropriate way to take a person model to json?

person = Person.objects.get(pk=1)
appstruct = person.to_dict()
cstruct = PersonSchema().serialize(appstruct)
response_body = json.dumps(cstruct)

Is this about right? Should I instead just be going from dict to json?

You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/pylons-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to