Closed abdullahCode511 closed 5 months ago
I could be wrong but I don't think this is valid.
The user_id
should work regardless of UserMixin. The fact that we still build a class named users
for the database might be the issue here. The table already exists in the DB. All we need is to either start working with it using PyMySLQ or use reflection to build the SQLAlchecmy classes from the existing database.
fixed
i faced a conflict on (user_id) i had to change it temporarily to (id) in the database. the conflict happened in UserMixin function provided by flask_login library
from flask_login import UserMixin, login_user, LoginManager, login_required, logout_user, current_user
in app.pyline 46 in /flask-website/app.py `class users(db.Model, UserMixin):
this variable(id) we cant change the name to (user_id) because it will conflict with UserMixin
upon further investigation i found out that UserMixin only accept (id) as the variable name