Closed nikolas closed 10 years ago
See #80, this adapter does not support pagination yet. To make it work you either need to modify the adapter (meaning, fix #80) or disable pagination on DRF
I'm working on updating the adapter to properly support ember-data beta.10 (#101). I think I should be able to get pagination working but I'm not sure if I'll hit some problems yet. I'm a bit busy with other work now but I'm hoping to get back to this shortly.
I'm looking at #101 and trying to fix those test failures. It looks like there's a lot of methods from DS.RESTAdapter
to re-implement.
Maybe it would be better to configure django-rest-framework to return the JSON format that DS.RESTAdapter
/ DS.ActiveModelAdapter
expects. I'm looking into that now.
Yeah, there's a some code for this by @Goldcap pointed to in #80
https://github.com/Goldcap/operis
I think the adapter needs a full rework. I guess it's just easy to deal with this server side like you suggest but there's still a benefit to having an adapter work with the default django-rest json when you can't change the server bits.
The code I have right now is processing the json into the right format on the JavaScript side instead of the server side.
If you just want to get something going, you can always use the adapter with ember-data beta.8 with ember 1.7.0. I'm using it in a project and it seems to be working ok.
Hey, thanks for the shoutout, and yes, I eventually decided to implement most of the changes in Django. Also, note, my paginator only works for parent records, I had to implement a separate solution for pagination of many-to-many or one-to-many records.
Ping me back if anyone wants to see it, this WIP is fairly old already :)
@Goldcap If you're interested / have time it would be cool to see that work extracted to make it easier to find. I don't mean to add more work to your plate though. :)
Hi Ben;
Absolutely, will upload probably this weekend. Sorry for the very late reply! Everyone loves pagination.
On Fri, Oct 3, 2014 at 9:48 AM, Ben Konrath notifications@github.com wrote:
@Goldcap https://github.com/Goldcap If you're interested / have time it would be cool to see that work extracted to make it easier to find. I don't mean to add more work to your plate though. :)
— Reply to this email directly or view it on GitHub https://github.com/toranb/ember-data-django-rest-adapter/issues/104#issuecomment-57798370 .
"If there is Evolution, why are there monkeys?" - Larry King
Will be addressed in dustinfarris/ember-django-adapter#22
Hi, I have an API response from Django REST Framework v2.4.3 that looks like this, for
/api/puzzles/
I've connected this to my Ember application with DS.DjangoRESTAdapter. When I run
WeatherRoulette.__container__.lookup('store:main').find('puzzle')
, ember-data says it's expecting a different format:I've forgotten how to customize the JSON root for ember-data. I just want to point it to
results
. Is there a simple config change for this? I'm using Ember 1.7.0, ember-data 1.0.0-beta.10.Thanks.