Ember-data & find/findQuery


#1

I’m relatively new to ember and have got an initial app up and running using ember-data to hook back to a django back-end. All works fine but now I’m stumped trying to figure out how to use find or findQuery to search for elements based upon a date range.

On the server-side I’m using tastypie and a simple

http://localhost/api/v1/data?format=json&date__gte=2012-06-01

works fine - but struggling to understand how to access this functionality through ember-data.

Can anyone help?

Thx

Al


#2

Al,

App.Model.query({date__gte: '2012-06-01'})

#3

Nerdyworm,

Thanks - got me on the right track. Using the adapter for django-tasypie I had to ensure the default response was set to JSON by overriding the following method in my resource:

def determine_format(self, request):
        return 'application/json'

This then changed the api call to:

http://localhost/api/v1/data?date__gte=2012-06-01

And

App.Model.query({date__gte: '2012-06-01'})

then worked fine.