

@staticmethod
def register(username, password):
    user = User(username=username)
    user.set_password(password)
    db.session.add(user)
    db.session.commit()

dataset/ETHPy150Open miguelgrinberg/oreilly-intro-to-flask-video/7a/app/models.py User.register/original