You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a setup where we are using a ManyToMany field with a through model, similar to the situation described in this forum post from the json-api spec .
It seems like there are two ways of approaching this. One would be to use the meta key in the relationship, such as:
Right now in my app, the response does not respect the through key when using a ResourceRelatedField. The resulting response relationships key has a type of objective, as opposed to objective-concept-link.
Are either of these solutions possible with this library? If so, how?
The text was updated successfully, but these errors were encountered:
Currently meta is not supported with ResourceRelatedField but would be a good addition.
That your second approach is not working is most likely a bug. What you could do is to work around it to define a included_serializers with the objective relationship and define the correct resource_name.
Marking this issue as a bug, any investigation and PRs are most welcome.
To implement it, I would suggest that a get_meta(rself, esource) returning a dict is added to ResourceRelatedField and then called at the appropriate spot in the renderer. A user can then create its own ResourceRelatedField with the desired meta fields.
I have a setup where we are using a ManyToMany field with a through model, similar to the situation described in this forum post from the json-api spec .
It seems like there are two ways of approaching this. One would be to use the
meta
key in the relationship, such as:Is this possible in using this library?
On the other hand, I could have the relationship point to the
through
model, which would be formatted as such:Right now in my app, the response does not respect the
through
key when using a ResourceRelatedField. The resulting responserelationships
key has a type ofobjective
, as opposed toobjective-concept-link
.Are either of these solutions possible with this library? If so, how?
The text was updated successfully, but these errors were encountered: