from hello import db
db.drop_all()
from hello import Role, User
admin_role = Role(name=‘Admin’)
mod_role = Role(name=‘Moderator’)
user_role = Role(name=‘User’)
user_john = User(username=‘john’, role=admin_role)
Traceback (most recent call last):
File “”, line 1, in
File “”, line 4, in init
File “e:\pythonproject\flask-future\venv\lib\site-packages\sqlalchemy\orm\state.py”, line 480, in initialize_instance
manager.dispatch.init_failure(self, args, kwargs)
File “e:\pythonproject\flask-future\venv\lib\site-packages\sqlalchemy\util\langhelpers.py”, line 70, in exit
compat.raise(
File “e:\pythonproject\flask-future\venv\lib\site-packages\sqlalchemy\util\compat.py”, line 207, in raise_
raise exception
File “e:\pythonproject\flask-future\venv\lib\site-packages\sqlalchemy\orm\state.py”, line 477, in _initialize_instance
return manager.original_init(*mixed[1:], **kwargs)
File “e:\pythonproject\flask-future\venv\lib\site-packages\sqlalchemy\orm\decl_base.py”, line 1142, in _declarative_constructor
raise TypeError(
TypeError: ‘username’ is an invalid keyword argument for User