public PaulUithol / backbone-tastypie
JavaScriptPythonA small compatibility layer to make backbone.js and django-tastypie work together happily. — Read more
Latest commit to the master branch
Set auth headers for the extra GET on an empty POST response as well.… …
… Fixes #18.commit f253883cc9PaulUithol authored 11 days ago
name age message backbone_tastypie 11 days ago Set auth headers for the extra GET on an empty POST response as well.… [PaulUithol] test 11 days ago Set auth headers for the extra GET on an empty POST response as well.… [PaulUithol] .gitignore 5 months ago Upgrade test libs, add a .gitignore [PaulUithol] MANIFEST.in 8 months ago Add MANIFEST [areski] README.md 8 months ago Fix Readme wrong application name to include in INSTALLED_APPS [areski] setup.py 8 months ago Fix installer setup.py to include package data [areski] README.mdBackbone-tastypie
A small conversion layer to make backbone.js and django-tastypie work together happily.
Usage
Add
backbone_tastypie
to yourINSTALLED_APPS
setting, and add the following to your base template:<script type="text/javascript" src="{{ STATIC_URL }}js/backbone-tastypie.js"></script>
How it works
Specifically, it overrides
Backbone.sync
to do a GET request after creating an object (if there is no response body), and overridesBackbone.Model.prototype.idAttribute
,Backbone.Model.prototype.url
,Backbone.Model.prototype.parse
andBackbone.Collection.prototype.parse
.
Backbone.Collection.prototype.url
is overridden so it can build urls for a set of models when using thefetchRelated
method in Backbone-relational.
Tuesday, May 29, 2012
PaulUithol/backbone-tastypie - looking forward to playing with this.
via github.com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment