This is my code in my html
{% for summary in psummary %}
<tr>
<td colspan="3" class="tdcell">{{summary.Description}}</td>
<td colspan="2" class="tdcell">{{summary.Start_Grading_Period}}</td>
<td colspan="2" class="tdcell">{{summary.End_Grading_Period}}</td>
<td colspan="2" class="tdcell">{{summary.Method}}</td>
<td colspan="3" class="tdcell"><span style="text-align: right;font-weight: 600;" class="close" onclick="deleteRow(this)"><a href="url:delete_view">×</a></span></td>
</tr>
{% endfor %}
this is how it looks like
this is my views.py
def function(request,part_id =None):
object = gradingPeriodsSummary.objects.get(id=part_id)
object.delete()
print(object)
return render(request, 'admin/Homepage/view.html')
urls.py
path('delete/(?P<part_id>[0-9]+)/$', Homepage.views.function, name='delete_view'),
i just want that if the teacher click the close button it will delete the record in the database
i followed the instruction here, but its not working Django - How to delete a object directly from a button in a table

print(object)as it's .... deleted. Beside that, your code looks correct, what's the matter?