Closed nanuxbe closed 3 months ago
This seems to be related to https://github.com/carltongibson/neapolitan/pull/44
Hi @nanuxbe. Yes, good spot.
The list view template assumes you routed the create view. That's probably a bug rather than a feature: better would be to say if you routed the create view...
(Same in get_context_data()
)
This seems to be related to https://github.com/carltongibson/neapolitan/pull/44
So yes: we only just added routing a subset of roles, so this is a hangover from that.
I think wrapping in try...except...
and setting create_view_url
to None
in the context (and then using an {% if %}
in the list template would be correct there.
For the actions
helper, I guess that needs to be per-action, and then only rendering the links for the existing actions.
Would you fancy taking that on @nanuxbe? (If not, I will potter on it over the next period.)
Thanks for the report!
Yes, I can take that on, this is basically already mostly what I've done to get it running locally, I'll clean this up and make a proper PR with it
Great thanks.
Essentially the templates (and helpers) need to handle the case where some view isn't routed.
Welcome aboard! ⛵️
Hello,
I'm finally trying out neapolitan :-)
So, my first use-case is to have a CRUD without the C (records are created by something else).
So assuming
*ContactListView.get_urls(roles={Role.LIST})
in myurls.py
, going to http://localhost:8000/contactlst/ produces aNoReverseMatch
error.This seems to be due to https://github.com/carltongibson/neapolitan/blob/main/src/neapolitan/views.py#L374
patching
get_context_data
to catch the exception leads to similar error during rendering from https://github.com/carltongibson/neapolitan/blob/main/src/neapolitan/templatetags/neapolitan.py#L9 so I'm not sure about where to go from here? Whether this is a feature or a bug.Thank you for your time