Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amccloud/backbone-tastypie
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.
https://github.com/amccloud/backbone-tastypie
Last synced: 17 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/amccloud/backbone-tastypie
- Owner: amccloud
- License: mit
- Created: 2012-05-11T19:21:47.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-22T23:41:44.000Z (about 12 years ago)
- Last Synced: 2024-07-31T22:45:01.726Z (3 months ago)
- Language: JavaScript
- Size: 268 KB
- Stars: 99
- Watchers: 13
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backbone Tastypie [![Build Status](https://secure.travis-ci.org/amccloud/backbone-tastypie.png)](http://travis-ci.org/amccloud/backbone-tastypie]) #
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 ##
```javascript
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
```