Browse files

Merge remote-tracking branch 'remotes/lincolnloop/master'

  • Loading branch information...
PaulUithol committed Sep 13, 2011
2 parents 41ca1ba + c3f3191 commit a2d1da77b52d7550085cdc67cb2335dc0d0e9605
@@ -1,6 +1,11 @@
# Backbone-tastypie
A small conversion layer to make [backbone.js]( and [django-tastypie]( work together happily.
+## Usage
+Add `django_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>`
+## 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](
No changes.
File renamed without changes.
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+from distutils.core import setup
+ name='Backbone-tastypie',
+ version='1.0',
+ description='A small conversion layer to make backbone.js and '
+ 'django-tastypie work together happily.',
+ author='Paul Uithol',
+ author_email='',
+ url='',
+ packages=['backbone_tastypie'],
@@ -10,7 +10,7 @@
<script type="text/javascript" src="./lib/underscore.js"></script>
<script type="text/javascript" src="./lib/backbone.js"></script>
<script type="text/javascript" src="./lib/backbone-relational.js"></script>
- <script type="text/javascript" src="../backbone-tastypie.js"></script>
+ <script type="text/javascript" src="../backbone_tastypie/static/js/backbone-tastypie.js"></script>
<!--<script type="text/javascript" src=""></script>-->
<script type="text/javascript" src="./lib/qunit.js"></script>

0 comments on commit a2d1da7

Please sign in to comment.