Save radio value in a cookie, Python CGI Programming

12 Views Asked by At

The title basically. I tried googling but it seems there is no much material on the subject. I have to store data for each subject('Not selected', 'Enrolled', 'Passed') in every year and print it all on one page. Here is a part of my code:

for key, value in podaci.subjects.items():
    for k in value:
        if year == value[k]:
            print(f'''<tr>
            <td>{value['name']}</td>
            <td>{value['ects']}</td>
            <td><input type="radio" name="{value['name']}" value="Not selected">Not selected</td>
            <td><input type="radio" name="{value['name']}" value="Enrolled">Enrolled</td>
            <td><input type="radio" name="{value['name']}" value="Passed">Passed</td>
            </tr>''')

Radio names are based on subjects and I am thinking I would save it in a cookie based on name of a value of radio. Any tips how should I go about it?

0

There are 0 best solutions below