Skip to content

Incorrect resource type on inverse proxy models? #285

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

Closed
dolgafar opened this issue Sep 22, 2016 · 1 comment
Closed

Incorrect resource type on inverse proxy models? #285

dolgafar opened this issue Sep 22, 2016 · 1 comment

Comments

@dolgafar
Copy link

dolgafar commented Sep 22, 2016

Hello,

I've used the proxy model approach as suggested in #166, this works nicely and you can even assign different permissions to resources based on this in Django.

But when I use the inverse relation (related_name), the resource name is taken from the "base model" and not the proxy model. Normally it would use the JSONAPI meta on the proxy model, but this can't be used in this case.

Does it make sense? :) I should say, I'm quite new to drf json-api, but it rocks really well with Ember.

I've removed the inverse relation field for now, because it confuses Ember data, but I loose a lot of finesse and included data option.

Could it be possible to set resource_name manually on the ResourceRelatedField ? Or is there some other smart way I haven't figured out?

Thanks a lot for a great package...

@sliverc
Copy link
Member

sliverc commented May 3, 2018

I think #306 addresses your issue where resource_name can be configured on an serializer resp. also included_serializers for relations. Closing this issue but please comment if this doesn't fix your issue.

@sliverc sliverc closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants