Radio button

41 views
Skip to first unread message

piasek piasek

unread,
Dec 15, 2015, 2:41:23 PM12/15/15
to Django users
I would like prepare django form for several entries for one model.
Let's assume I have model Photo where I upload and save image.
From model I will takie 10 entries and for each of image I would like generate forms to set title, description, check if photo is active.
That part I have it and is working fine, but I have problem to set to this forms radiobutton. From all of this entries I would like choose 
one which will be a covered photo. Normally we can use choices and eveyrthing is ok, but how I can seperate them and attach to each photo?
Do you have any suggestions?

Thanks

Billu

unread,
Dec 16, 2015, 12:23:33 PM12/16/15
to Django users
The question wasn't clear { to me }. Could you give any link to a similar site.

As for sending data about which radio button was chosen, you could generate name for radio button and when the form is submitted, it sends the data via POST.
<input type="radio" name="{{ name_of_picture_linked_to_this_radio_button }}"">
Reply all
Reply to author
Forward
0 new messages