how do I json encode this view?
问题 New to python and Pyramid. I have a view that does pagination. How do I json encode it? I get an error "object at 0x2d16d90> is not JSON serializable" when I try this: @view_config(route_name="paginate") def paginate(request): query = DBSession.query(MyTable) page_url = paginate.PageURL_WebOb(request) customers = paginate.Page(query, page=int(request.params.get("page", 1)), items_per_page=25, url=page_url) if "partial" in request.params: # Render the partial list page return render_to