toranb / ember-data-django-rest-adapter

An ember-data adapter for django web applications powered by the django-rest-framework
MIT License
154 stars 27 forks source link

[BUGFIX] Use 'dasherize' instead of 'decamelize' when transforming model names #94

Closed dustinfarris closed 10 years ago

dustinfarris commented 10 years ago

DRF uses dashes in root URLs, not underscores, e.g. /api/school-teachers/

This PR doesn't affect the rest of the URL in which DRF does use underscores, e.g. /api/children/4/school_teachers/

dustinfarris commented 10 years ago

Actually, this may only apply to my use of DRF.

e.g.:

router.register('school-teachers', viewsets.SchoolTeacherViewSet)

which means this PR is opinionated and probably shouldn't be merged unless using dashes is preferred by the majority.

I'll leave this open for a while for any +1's .. and will close without merging if I don't get any feedback.

dustinfarris commented 10 years ago

So I think the easiest way to do this is to extend the adapter. Example (using ember-cli addon): https://github.com/dustinfarris/ember-django-adapter/wiki/Cookbook#use-dashes-in-url-prefixes