Apparently if you don't specify .all() or .first() it defaults to .all() but I would still specify
.all() to make your code explicit.
When you are getting the index out of bounds error what index is it throwing the error at? Perhaps
add a print(i) just inside the loop. If you are passing X mycheckboxs, the query is returning Y
results then you will get an index error if X > Y
Perhaps add this code to see if it makes things clear for you.
ANONYMOUS wrote:> I'm trying to use a link to the quiz page and automatically display the chosen quiz by > using types and then "int(request.args.get('type'))" however when I then go to use this > type to filter the quizes by quizCode, this breaks my code and gives me an index out of > bounds error. I tried converting the type to an int but it seems to somehow turn itself > back into a NoneType every-time the code tries to run and I'm not sure why. The code works > fine if I manually type quizCode='1' for example but when using selectedQuiz it breaks.
Why does changing one input break this code segment? (all 5)