我想在点击删除按钮时创建一个确认弹出窗口。它目前正在运行并立即删除。这是我的一些代码: views.py:
Proto Local Address Foreign Address State
TCP 0.0.0.0:2181 0.0.0.0:0 LISTENING
[java.exe]
TCP [::1]:2181 [::1]:62268 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62279 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62280 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62281 ESTABLISHED
[java.exe]
的index.html
class patientDelete(LoginRequiredMixin, DeleteView):
model = patient
success_url = reverse_lazy('patients:index')
和我的urls.py
<form action="{% url 'patients:patient-delete' patient.id %}" method="post" style="display: inline;">
{% csrf_token %}
<input type="hidden" name="patient_id" value="{{ patient.id }}" />
<button type="submit" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-trash"></span>
</button>
</form>
我搜索了左,右和中心,并没有真正理解它的大部分内容。我一直在使用很多教程来帮助我,这对django来说还是一个新手。感谢您的帮助!