Hello: while registering int object not subscriptable error coming, even though i truncate [0] from results. Any thoughts
1 Answer
Are you sure both session
and results
are dict
s?
-
Correct me, through results["id"] we will access id (primary key) of the table in the database and this will bes saved under session ["user_id"]. As per what i know session in flask is a dictionary. As the property of dictionry is it has key value pairs, so how to confirm whether results is dictionary,? as debug mode is off. Thanks for your time– mann__10Commented Jan 2, 2020 at 9:32
-
@MannawarHussain I would print both values and double-check if that's true.– kzidaneCommented Jan 2, 2020 at 13:42
-
i tried to print the values for both by inserting statements (print(session) & print(results)) inside register route, sorry could not insert screenshot here, and then do flask run but it is not printing any values, and also couldnot do python application.py Kindly advice– mann__10Commented Jan 3, 2020 at 6:33
-