-
-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RW support to the REST API #75
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This package seems to be more flexible, better documented and is more actively developed.
Since it looks we're going forward with Rest Framework, the v1 api will remain read-only and this is won't be needed
TODOS:
|
This is basically the form used by the Django REST Framework, with some things tweaked to fit into the application design.
For this to work, it is necessary that the ViewSets have either a 'ordering_fields' or a 'serializer_class' attribute
This needed an external django app, 'django-filter'
Since the API now supports write operations, the testcases test performing DELETE, POST, PATCH and PUT operations --HG-- rename : wger/config/tests/test_language.py => wger/core/tests/test_language.py
This change makes the fields that control ownership optional. This is the case when not all fields are present in the request, e.g. when PATCHing the resource.
- Tests that PATCH actually allows to change each individual field - Test some results from the API testcase by looking into the DB - Some more tests when PUTting to a detail resource
For some reason, having a max_length was causing an exception "object of type 'int' has no len()" when updating anything via the API
--HG-- extra : amend_source : a5e3dc39de561fbc8682002a82c5f698507606a0
- New abstract class with simplified status (accepted, pending, declined) - New manager with custom filters (.accepted(), etc.) --HG-- extra : amend_source : e8a8c9a252537e03dbe235c056645b1c29f42cb4
--HG-- rename : wger/exercises/tests/test_submitted_exercise.py => wger/exercises/tests/test_submitted_image.py
rolandgeider
added a commit
that referenced
this pull request
Jun 21, 2014
Add RW support to the REST API
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests adds full RW support for the REST API. Tastypie is being replaced by Django REST Framework, as this seems more actively developed, the documentation is better and it seems easier to extend and configure the endpoints and behaviour. The /api/v1 will be deprecated and removed in the future (1 year perhaps?)