Re: [pylons-devel] Using Colander to go from Python object to JSON

2016-11-29 Thread Alex Kessinger
truct = person.to_dict() > if validate(appstruct, PersonSchema()): > return json.dumps(appstruct) > > - Michael > > > On Mon, Nov 28, 2016 at 3:00 PM, Alex Kessinger > wrote: > >> Hi, I have a question about the appropriate use of Colander to go from a &g

[pylons-devel] Using Colander to go from Python object to JSON

2016-11-28 Thread Alex Kessinger
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 PersonSchema. Would this be an appropriate way to take a person model to json? person = Person.objects.get(pk=1) appstruct = person.