Skip to content

Instantly share code, notes, and snippets.

@thequbit
Created September 6, 2013 19:18
Show Gist options
  • Save thequbit/6468604 to your computer and use it in GitHub Desktop.
Save thequbit/6468604 to your computer and use it in GitHub Desktop.
@view_config(route_name="/posts.json", renderer='templates/posts.pt')
def posts_view(request):
posts = []
_p = DBSession.query(BlogModel)
for p in _p:
posts.append(p._json())
retval = {"posts":posts}
return {"retval":retval}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment