Skip to content

Support specifying lookup name for hyperlinked fields to related_views #919

Closed
@SafaAlfulaij

Description

@SafaAlfulaij

Refer to: #904

There is no way currently to pass a custom lookup name of related_views to hyperlinked fields.
The below field should link to /entries/123/comments instead of /entries/123/comments_hyperlinked.

    comments_hyperlinked = relations.HyperlinkedRelatedField(
        related_link_view_name="entry-related",
        related_link_url_kwarg="entry_pk",
        self_link_view_name="entry-relationships",
        many=True,
        read_only=True,
        source="comments",
    )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions