zalsaeed / cgav

Certificate Generation and Verification
GNU General Public License v3.0
3 stars 1 forks source link

the users table #7

Closed abdullahCode511 closed 5 months ago

abdullahCode511 commented 8 months ago

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.py

line 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

id = db.Column(db.Integer, primary_key=True, unique=True)
user_name = db.Column(db.String(20), nullable=False, unique=True)
password = db.Column(db.String(80), nullable=False)`

upon further investigation i found out that UserMixin only accept (id) as the variable name

zalsaeed commented 8 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.

zalsaeed commented 5 months ago

fixed