esoergel / peacecorps

Random Hacks of Kindness - Boston
2 stars 7 forks source link

Use auto-serialize library to serve JSON blog entries #41

Closed esoergel closed 11 years ago

esoergel commented 11 years ago

Add an as_dict method to objects to be returned, only passing necessary fields. If more fields need to be added, update the as_dict method on the model definition.

esoergel commented 11 years ago

Okay, I've got this working now. Serialization info (as_dict) makes sense to store with the models, so I like this method. There are a couple other issues to be worked out, but I'll file those separately

esoergel commented 11 years ago

I can't serialize the image field (" is not JSON serializable"), @baconz , you got any tips?

Also, pagination doesn't seem to be working, I'll look into that later. (I think I need to override dispatch; it's based off of BaseListView) edit: actually, maybe it IS working, but because I have fewer than 5 entries, it says "not paginated" For future reference, to get page 2, just add a get parameter page=2

baconz commented 11 years ago

Just put up a pull request for this.

From: Ethan Soergel [mailto:notifications@github.com] Sent: Wednesday, June 19, 2013 2:38 AM To: esoergel/peacecorps Cc: Seth Madison Subject: Re: [peacecorps] Use auto-serialize library to serve JSON blog entries (#41)

I can't serialize the image field (" is not JSON serializable"), @baconzhttps://github.com/baconz , you got any tips?

Also, pagination doesn't seem to be working, I'll look into that later. (I think I need to override dispatch; it's based off of BaseListView

— Reply to this email directly or view it on GitHubhttps://github.com/esoergel/peacecorps/issues/41#issuecomment-19665623.

esoergel commented 11 years ago

Thanks, I just merged it in.