I'm using flask to make a scheduler app. I have a function that will take a list of college courses from the url and schedule them. Is there any way to make a form that people could enter the classes in as opposed to using the url?
My view function:
@app.route('/sched/<some_list>')
def scheduleMe(some_list):
course_list = some_list.split(',')
my_combos = scheduler.schedule(course_list)
return render_template("sched.html", title="Scheduler", combos=my_combos)
takes in a list of courses such as BT 353,CS 135,HHS 468,BT 181,CS 146,CS 284
and returns a page with all the possible schedules for those courses.
I'm trying to make some sort of form where if a user entered the courses above it would redirect them to www.mysite.com/sched/<courses they enter>
. I was going to use GET and then basically make a view function that was take the resulting url from the form and pull the courses out of the query.
Is there a better/ more direct way to do this?
Thanks!