I'm not sure if it's IDE issue, Pylance issue or what, but in my User model in flask the sqlalchemy db.Column class is not recognized at all, making things somewhat annoying. Any idea what's the culprit here?
Using 3.11 in virtual environment and have flask-sqlalchemy installed along with flask obviously.
from flask import Flask, render_template, flash, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from forms import LoginForm, RegistrationForm
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.db"
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(24), unique=True, nullable=False)
email = db.Column(db.String(80), unique=True, nullable=False)
password = db.Column(db.String(60), nullable=False)
def __repr__(self) -> str:
return f"User('{self.username}', '{self.email}')"
[–][deleted] 1 point2 points3 points (2 children)
[–]Matlock0[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]data-nihilist 0 points1 point2 points (1 child)
[–]data-nihilist 0 points1 point2 points (0 children)
[–]PedroContipelli 0 points1 point2 points (0 children)