Modifications to Backbone's Model an Collection so that they play nice with django-tastypie. Includes a way to easily paginate over a resource list and a way to access the associated meta information.
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 16 commits ahead, 3 commits behind amccloud:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
backbone-tastypie.js
testem.yml

README.md

Backbone Tastypie Build Status

Modifications to Backbone's Model an Collection so that they play nice with django-tastypie. Includes a way to easily paginate over a resource list and a way to access the associated meta information.

Example

var User = Backbone.Model.extend({
    urlRoot: '/api/v1/user/'
});

var Users = Backbone.Collection.extend({
    urlRoot: '/api/v1/user/',
    model: User
});

// /api/v1/user/?active=true
var activeUsers = new Users({
    filters: {
        active: true,
    }
});

// Fetch first 20 users.
activeUsers.fetch();

// Fetch and add next 20 users.
activeUsers.fetchNext();

// Total number of users.
activeUsers.meta.total_count