Here's the problem: in my rendered html-page I have multiple what I call 'thumbnails' of text data aka Notes (Note is my Model in Django). I decided it would be good idea to bind button "Delete" to every thumbnail: User clicks "Delete" on some Note —> it's get deleted. What I've come to (in my views.py):
ids=[x.id for x in Note.objects.all()]
buttons = []
for x in ids:
buttons.append('DeleteButton' + str(x))
if (request.GET.get(x for x in buttons)):
print("Button click registered @ ", x)
Well, It doesn't actually register any button clicks and thus not printing "click registered". My button looks like this in notes.html:
<input type="submit" class="btn btn-default" value= "DeleteButton" name="DeleteButton{{ Note.id }}">
Any ideas how can I actually register any buttons clicked? Thanks in advance!