в intex.html написала
<select name="linksNav" size="1">
{% for x in t %}
<option value="{% url 's' s_id=x.id %}"> {{x.calendar}}</option>
{% endfor %}
<input type="submit" value="ok"></p>
</select>
в представлении добавила
def intex(request):
if request.user.is_authenticated():
t=Application.objects.filter(status1=True)
return render(request, 'application/intex.html', { 't' : t } )
else:
return HttpResponseRedirect(reverse('account.views.login'))
def s(request,s_id):
t=Application.objects.get(pk=s_id)
t.status3=True
t.save();
return render(request, 'application/index.html')
в urls.py написала
url(r'^intex/$', 'application.views.intex', name = 'intex'),
url(r'^(?P<s_id>\d+)/$', views.s, name='s'),
intex.html отображается правильно. но как только добавляю в intext.html {%ur...}
выходит сообщение
Exception Type: NameError
Exception Value:
name 'views' is not defined
с указанием на эту строку
Exception Type: NameError
Exception Value:
url(r'^(?P<s_id>\d+)/$', views.s, name='s')