A small compatibility layer to make backbone.js and django-tastypie work together happily.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits ahead, 52 commits behind PaulUithol:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
backbone_tastypie
test
.gitignore
MANIFEST.in
README.md
setup.py

README.md

Backbone-tastypie-amd

This is fork of Paul Uithol's great backbone-tastypie conversion layer to make backbone.js and django-tastypie work together happily.

This fork adds AMD support so you can load backbone-tastypie.js using a require library like requirejs.

Requirements

This software assumes you are using the AMD optimised version of backbone. This is required because backbone-tastypie-amd will rely on backbone being a registered module with its own requirements (such as underscore) defined.

Usage

  1. Add backbone_tastypie to your INSTALLED_APPS setting.
  2. Ensure that your main.js knows the paths of backbone (the AMD optimised version!) and backbone-tastypie. For example:
    require.config({
      paths: {
        "backbone": "/static/js/backbone",
        "backbone-tastypie": "/static/js/backbone-tastypie"
      }
    });
    
  1. When you need backbone-tastypie simply call:
    require(["backbone-tastypie"],function(Backbone) {
      // This code loads when backbone-tastypie and all of its dependencies are loaded.
      // The local backbone variable is the modified backbone-tastypie one.
      // If you want vinalla backbone, you can just change ["backbone-tastypie"] to ["backbone"]!
    });