Skip to content

Decouple url_base and view_name #67

Description

@SamuelJennings

At the moment, CRUDView.url_base is strongly coupled with the path name for a given role (see Role.get_url) which I don't think makes a lot of sense.

IMO, the base component of the path name should always default to cls.model._meta.model_name and MAYBE have a separate option at the class level to change it, e.g. CRUDView.path_name_base or whatever.

On another note, why provide the url_base option at all? This functionality can already be handled in urls.py using the include function.

urlpatterns = [
    path("my-url-base/", include(MyCRUDView.get_urls()),
] 

IMO (again), the above is a much simpler and easy-to-understand way to declare this as opposed to a class-based option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions