Closed nanuxbe closed 1 week ago
While creating this PR though, I noticed it was rather straightforward to remove actions but that adding an action (ie: duplicate, archive, open, ...) would be rather complicated due to the nature of Role that cannot be extended.
I am thinking about refactoring Role to be more flexible (either not an Enum anymore or implementing something like a role_factory). It would probably be best left in its own PR but it could very well be included here too.
Ah, yes. Separate issue. 😅 I have thoughts in this direction, that I need to upstream. Roughly: The core CRUD roles should be an enum — there just are the options there are. BUT we need a role protocol, which can be implemented by a custom role-like composing the core CRUD roles plus additional extra actions.
At that point it's feasible that we can automatically add links to the templates for custom actions.
@nanuxbe, I just tried your branch, but still getting the same -create' is not a valid view function or pattern name.
error.
# pyproject.toml
neapolitan = {git = "https://github.com/nanuxbe/neapolitan.git"}
@dacodekid You probably need to specify the PR branch.
@carltongibson
I tried that as well but still getting the same error. I'll wait until this gets merged.
neapolitan = { git = "https://github.com/nanuxbe/neapolitan.git", branch = "fix_#46_NoReverseMatch" }
Great. Thanks for the follow up @nanuxbe. I'll pull this in later on. Have a great Sunday.
Hey @carltongibson ,
here's the (initial?) PR for #46 with the changes discussed in the issue.
While creating this PR though, I noticed it was rather straightforward to remove actions but that adding an action (ie: duplicate, archive, open, ...) would be rather complicated due to the nature of
Role
that cannot be extended.I am thinking about refactoring
Role
to be more flexible (either not anEnum
anymore or implementing something like arole_factory
). It would probably be best left in its own PR but it could very well be included here too.