Skip to content

Move the detail_route / list_route lists back to ViewSet #2934

@xordoquy

Description

@xordoquy

During a workshop on Django REST framework, I realized the browsable API doesn't have links to the list_route / detail_route actions.
While I started working on implementing it I realized it should be the ViewSet responsibility to provide a list of custom actions. Currently all the work is done by the Router.

I'm opening the issue to discuss the possible directions.
My first though was to move the code that gathers the custom actions to the ViewSet. However, I'm not too happy with it as it relies on the ViewSet members having or not a bind_to_methods attribute attached.
My proposal would be to have two lists (possibly dictionaries) within the ViewSet that do hold the list_route and detail_route members. The decorator would then register their member to the ViewSet.

Thoughts ?

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy