Skip to content

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.

License

Notifications You must be signed in to change notification settings

amccloud/backbone-tastypie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.Tastypie.Model.extend({
    urlRoot: '/api/v1/user/'
});

var Users = Backbone.Tastypie.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

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published