Carsten Fuchs
unread,Feb 27, 2017, 2:50:11 AM2/27/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi Richard,
Am 27.02.2017 um 04:01 schrieb Richard Belew:
> {%url 'djggApp/guest'guest.guestId 'update'%}
>
> but this generates a /NoReverseMatch/ error
>
> /Reverse for 'djggApp/guest' with arguments '(1, u'update')' and keyword
> arguments '{}' not found. 0 pattern(s) tried: []/
In the {% url %}, you use "update" as a parameter, so you should either
write
{% url 'djggApp:updateGuest' guest.guestId %}
or, for example
url(r'^guest/(\d+)/(?P<action>(update|something_else))$',
login_required(views.GuestUpdate.as_view()), name='updateGuest'),
(there are alternative ways for this, e.g. using \w+)
Note that your view must deal with the new parameter.
And in the template
{% url 'djggApp:updateGuest' guest.guestId 'update' %}
Best regards,
Carsten