tastypie-clientClient for Django-Tastypie based REST services | |
Download |
tastypie-client Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Philippe Muller
- Publisher web site:
- https://github.com/pmuller/
tastypie-client Tags
tastypie-client Description
tastypie-client is a Python client API for Django-Tastypie REST services.Quick startThese examples work on the tastypie_tutorial Django project.Create an Api object>>> from tastypie_client import Api>>> api = Api('http://127.0.0.1:8000/api/1/')>>> api< Api: http://127.0.0.1:8000/api/1/ >Finds an user by its ID>>> api.user< EndpointProxy http://127.0.0.1:8000/api/1/user/ >>>> user = api.user(1)>>> user< Resource user/1: {u'username': u'test_user', ...} >>>> user.usernameu'test_user'Look at its posts>>> user.postsGet the first one>>> user.postsResource entry/1: {u'body': u'foo body', u'title': u'foo!', u'id': u'1', u'user': < ResourceProxy user/1>, u'pub_date': u'2012-04-29T08:55:08', u'slug': u'foo'} >Alternatively, you load both of them with an unique HTTP request>>> user.postsProduct's homepage
tastypie-client Related Software