I just want to create and test db with flask-sqlalchemy. DB created yet succesfuly. My code:
class Entry(db.Model):
id = db.Column(db.Integer, primary_key=True)
occurences = db.Column(db.String(80), unique=True)
a = Entry('run.py:27')
Error:
a = Entry('run.py:27')
TypeError: __init__() takes 1 positional argument but 2 were given
If I trying to do this without arguments program returns this:
qlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: entry [SQL: 'INSERT INTO entry (occurences) VALUES (?)'] [parameters: (None,)]
error starts on line with
db.session.commit()