Thursday, 15 March 2012

django - Backbone.js appending [] to key name on fetch -


I'm working on a Django + BackboneJS application.

The following steps have been fetched on my collection on a given flow of my flow:

  loadAdsByPlace: function (filter, placeID, place_chill_list, page, success_funk) {var Self = this; Var data = {Page: Page, PlaceID: PlaceID, Place Chilled ID: Place Chilled ID List}; Data ["room"] = this.buildRooms filter (filter); Data ["bathroom"] = this.buildBathroomsFilter (filter); Var fetchOptions = {Data: Data, Reset: Incorrect, Delete: Incorrect, Success: success_func, Error: success_func}; This.fetch (fetchOptions); },  

The request is successfully hiting my thoughts, I can see the printing request. GET to console, but what I'm getting is:

  & lt; QueryDict: {u'rooms': [u'5 '], you' place id ': [u'538a8cd7beac9e1a33977449'], you 'ChildIdlist []': [u'525464 ', u'526706'], U 'Page': [u'1 ']} & gt;  

The problem is returning:

  u'placeChildIDList [] ': [u'525464', u'526706 ']  < / Ex> 

While I expect

  u'placeChildIDList ': [u'525464', u'526706 ']  

can not be found reason. Anyone can help

traditional option to true < / Code> While fetching.

  var fetchOptions = {data: data, reset: wrong, delete: wrong, success: success_func, error: success_func, traditional: true}; This.fetch (fetchOptions);  

No comments:

Post a Comment