I am trying to query from two tables.. my appointments and clients. the client number is my foriegn key in appointments that I can pull from the clients database on.
Right now, I am just returning guests to see what it is doing, I am getting this error: TypeError: repr returned non-string (type tuple)
@app.route('/calendar')
def weeklycal():
weekyrnum=request.args.get('weekyr')
guests = db.session.query(Appointments,Clients).filter(Appointments.clientnumber == Clients.clientnumber).filter(Appointments.weekyr == weekyrnum).all()
return
render_template(calbyWeek.html",guests=guests)
How can I query everything from appointments and clients with clientnumber being the column to join on (which is defined as the foreign key in Appointments model), and filter by the week?