We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Seems like related_link_lookup_field is not respected in SerializerMethodResourceRelatedField:
related_link_lookup_field
SerializerMethodResourceRelatedField
class BookSerializer(serializers.HyperlinkedModelSerializer): authors = relations.SerializerMethodResourceRelatedField( source='get_authors', model=Author, many=True, read_only=True, related_link_view_name='books-authors-list', related_link_url_kwarg='ext_book_id', related_link_lookup_field='ext_book_id', )
File "/src/django-rest-framework-json-api/rest_framework_json_api/renderers.py", line 140, in extract_relationships field_links = field.get_links(resource_instance) File "/src/django-rest-framework-json-api/rest_framework_json_api/relations.py", line 125, in get_links related_kwargs = {self.related_link_url_kwarg: kwargs[self.related_link_lookup_field]} KeyError: 'ext_book_id'
Looks like https://github.com/django-json-api/django-rest-framework-json-api/blob/develop/rest_framework_json_api/renderers.py#L140 get_links is missing lookup_field
get_links
lookup_field
kwargs: {'ext_book_id': 256} http://localhost:8000/api/books/256/authors/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Seems like
related_link_lookup_field
is not respected inSerializerMethodResourceRelatedField
:Looks like https://github.com/django-json-api/django-rest-framework-json-api/blob/develop/rest_framework_json_api/renderers.py#L140
get_links
is missinglookup_field
The text was updated successfully, but these errors were encountered: