Using SQLAlchemy to update several records with forms

I am trying to update my database with SQLAlchemy using forms in my Flask App. Currently, I am displaying all the data I want to be able to update in a table form:

<form method="POST" action="/update?weekyear={{ weekyear }}">
<div class="form-group">
    <table class="table">
        <thead class="thead-dark table-bordered">
           <th> Day </th>
           <th> Client </th>
           <th> Appt Type </th>
           <th> No. People </th>

        {% for each in appointmentsjoinclients %}
              <td>{{ appointmentsjoinclients[0].cabin }}</td>
              <td><select class="form-control" style ="width: 220px" name="client" value="{{ appointmentsjoinclients[0].client }}">
                <option selected> {{ appointmentsjoinclients[0].client }} {{ appointmentsjoinclients[1].firstname }} {{ appointmentsjoinclients[1].client }} </option>
              {% for client in clients %}
                <option value="{{client}}">{{}} {{client.firstname}} {{client.lastname }}</option>
              {% endfor %}
              <td><input type="integer" style ="width: 50px" name="appttype" value="{{ appointmentsjoinclients[0].appttype }}"></td>
              <td><input type="integer" style ="width: 50px" name="numberofpeople" value="{{ appointmentsjoinclients[0].numberofpeople }}"></td>


        {% endfor %}
    <input class="btn btn-primary" type="submit" value="submit">

Once I submit, I want to be able to update each record that was displayed in the table... however, I am struggling to understand the methodology behind using 2 primary keys and looping through each row of data that would need updated here.

in this case, I actually have a table Appointments and a Table Clients... the form is using a query of those two tables joined so I can also display the client name with ID.

class Appointments(db.Model):
 client = db.Column('ClientNumber', db.Integer, ForeignKey("Clients.ID"))
 weekyear = db.Column('WeekYr',db.Integer,primary_key=True)
 day = db.Column('Day',db.Unicode,primary_key=True)

   class Cients(db.Model):
   id = db.Column('id',db.Integer,primary_key=True,unique=True,autoincrement=True)
    firstname = db.Column('FirstName',db.Text)
    lastname = db.Column('LastName', db.Text)

In my flask app... how to I call the items out of the form for each row so I can update them in the Appointments table? In this case, each row's primary keys are weekyear and day. Then... I can update the client ID, appt type, and number of people according to what was put in that row's boxes....

Even if you can provide some pseudo code.. that would be extremely helpful! I understand how to update 1 record at a time with forms.. just not multiple using 1 form and 2 primary keys.

I thought that having a loop through might work.. but it is giving me an error

def updateappts():
    weekyear = request.args.get('weekyear')
    Days = Days.query.order_by(Days.displayord).all()
    for day in Days:

        linetoupdate.client = request.form['client']
        linetoupdate.appttype = request.form['appttype']
        linetoupdate.numberofpeople  = request.form['numberofpeople']

Error: BAD REQUEST. Browser or proxy sent a request that this server could not understand.