Skip to content

A small compatibility layer to make backbone.js and django-tastypie work together happily.

License

Notifications You must be signed in to change notification settings

jengdal/backbone-tastypie

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backbone-tastypie

A small conversion layer to make backbone.js and django-tastypie work together happily.

Usage

Add backbone_tastypie to your INSTALLED_APPS setting, and add the following to your base template:

<script type="text/javascript" src="{{ STATIC_URL }}js/backbone-tastypie.js"></script>

Backbone-tastypie depends on Backbone, version 0.9.10 (or newer), and thus on Underscore, version 1.4.3 (or newer).

How it works

Specifically, it overrides Backbone.sync to do a GET request after creating an object (if there is no response body), and overrides Backbone.Model.prototype.idAttribute, Backbone.Model.prototype.url, Backbone.Model.prototype.parse and Backbone.Collection.prototype.parse.

Backbone.Collection.prototype.url is overridden so it can build urls for a set of models when using the fetchRelated method in Backbone-relational.

About

A small compatibility layer to make backbone.js and django-tastypie work together happily.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.4%
  • Python 0.6%