escalant3 / ember-data-tastypie-adapter

An adapter to connect django applications powered by django-tastypie with ember.js apps
MIT License
102 stars 26 forks source link

implement sinceQuery to pass parameters of filtering #26

Closed WillianPaiva closed 10 years ago

WillianPaiva commented 11 years ago

i did this implementation because when i use a filtering like :

App.ReadsRoute = Ember.Route.extend({
   model: function() {
      return App.Read.find({is_read : false});

  },

  events: {
    more: function() {
      // NOTE: in the default configuration where the server API sends
      // results paginated, this will automatically load next page.
      return App.Read.find();
    },

    openRead: function(read) {
      this.transitionToAnimated('reads.show', {main: 'slideLeft'}, read);
    }
  }
});

the return for model works but on more it just implements offset and eliminate the filter

in the case of using the filtering also on the more return is even worst because sinceQuery is not even called

so the idea here was use the url generated by tastypie to keep searching the next pages instead of just increment offset and in that way keeping filtering used on the first query

i don't know if is the best idea any help is welcome.

I'm pretty new in python!!!!

obs: when i do with the more and model returns without any filtering both with my implementation and without works well and with my implementation + filtering ember still not loading the data properly but at least is looking at the proper url now

escalant3 commented 10 years ago

This seems like a very customized case. Are you able to do this with the latest version?