javascript - Backbone.js Collection and Tastypie filters - Stack Overflow

Instead of retrieving the entire table of records for a Backbone collection I've defined, I reckon

Instead of retrieving the entire table of records for a Backbone collection I've defined, I reckon it's much more efficient to make use of the tasty-pie filters I've created. How would I let Backbone use them? As far as I understand, Backbone models/collections only point to the top-level URI of the model.

e.g. I have a Bookings model defined in Django that can be accessed via "/api/booking" but i want to populate the Backbone Collection with "/api/booking?room=3" where the room number is context specific.

Instead of retrieving the entire table of records for a Backbone collection I've defined, I reckon it's much more efficient to make use of the tasty-pie filters I've created. How would I let Backbone use them? As far as I understand, Backbone models/collections only point to the top-level URI of the model.

e.g. I have a Bookings model defined in Django that can be accessed via "/api/booking" but i want to populate the Backbone Collection with "/api/booking?room=3" where the room number is context specific.

Share Improve this question asked Aug 15, 2011 at 9:10 sw00sw00 9802 gold badges16 silver badges30 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

I've found out that backbone's .fetch() method accepts the "data" attribute just like JQuery .ajax().

booking.fetch({ data : { "room" : 3 } });

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745114131a4612026.html

相关推荐

  • javascript - Backbone.js Collection and Tastypie filters - Stack Overflow

    Instead of retrieving the entire table of records for a Backbone collection I've defined, I reckon

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信