python - Django using UpdateView within a detail view? -
i'm having issues update view:
class updaterules(updateview): model = blacklist fields = ['numkey','bnum','days','blocked'] success_url='/'
i'm trying create edit form each object in list, on detail view page. here urls both, starting detailview:
url(r'^(?p<id>\d+)/$', views.post_detail, name='detail'), url(r'^update_rules/(?p<pk>[\w-]+)$', updaterules.as_view(),name='update_rules'),
so detail view page uses slug object id. context top level object "instance", , objects i'm trying update 'obj' assume when calling updateview need this:
{% obj in instance.blacklist_set.all %} <li><a href="{% url instance.id 'update_rules' obj.pk %}"><p style="font-size: 20px">{{obj.bnum}}</h2></a></li> <p>{{obj.pk}}</p> {% endfor%}
i keep getting "noreversematch @ /2/", when the slug page /2/. have been trying lots of variations no success. ideas?
Comments
Post a Comment