-
Notifications
You must be signed in to change notification settings - Fork 301
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
Create relationships using array of ids #243
Comments
So basically you are suggesting modifying the interface so that POSTing
does the same thing as
Is that correct? This seems like a reasonable shorthand to me... |
Correct. I was just thinking that this could be easily achieved with a preprocessor, but it's convenient for sure. Joël On Sep 23, 2013, at 6:14 AM, jfinkels notifications@github.com wrote:
|
Before the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") several issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Previously, the behavior of Flask-Restless was a bit arbitrary. Now we force it to comply with a concrete (though still changing) specification, which can be found at http://jsonapi.org/. This is a (severely) backwards-incompatible change, as it changes which API endpoints are exposed and the format of requests and responses. This change also moves JSON API compliance tests to a convenient distinct test module, `tests.test_jsonapi.py`, so that compliance with the specification can be easily verified. These tests correspond to version 1.0rc2 of the JSON API specification, which can be found in commit json-api/json-api@af5dfcc. This change fixes (or at least makes it much easier to fix or much easier to mark as "won't fix") quite a few issues, including but not limited to - #87 - #153 - #168 - #193 - #208 - #211 - #213 - #243 - #252 - #253 - #258 - #261 - #262 - #303 - #394
Flask-Restless now implements the JSON API protocol, so creating and updating relationships happen according to their specification, which is a bit different from the original implementation I had. (Theirs is better.) |
Currently Restless requires you to make relationships by passing the related object:
This makes sense when you're creating the related objects at the same time as the parent object, but not when you're making a relationship between existing objects. Therefore I'd propose adding the functionality to create relationships through passing an array of ids:
Is this something people would be interested in?
(I'm aware it is possible to passing an array of objects, which only include the id, i.e.:
{"comments": [{"id": 1}, {"id": 2}]}
)The text was updated successfully, but these errors were encountered: